Manually editing date field results in bogus date

Bug #1149696 reported by Michael Terry on 2013-03-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Indicator Date and Time
Fix Committed
indicator-datetime (Ubuntu)
Matthew Paul Thomas

Bug Description

If you manually edit the time field, the time correctly changes.

But if you manually edit the date field, it either:

A) Won't work (you'll see a warning in the terminal like "** (gnome-control-center:4707): WARNING **: Could not understand 03/07/2013")

B) Or screw up your date (if in Canada, it will reset it to epoch because it is interpreting a two-digit year, and trying to set the year to 13 CE)

This is because of which tried to fix bug 729056.

But I think fixing that bug is ill advised. We can reliably format a date into a locale-specific display string. But as far as I recall, there is no way to either:
A) Programatically format a locale-specific display string back into a date
B) Or programatically query what the locale-specific display string breaks into (i.e. is "%x" really "%y-%m-%d"?)

So if we show the data in the locale-specific way, there's no way to parse it back again, when the user edits the text box.

We should go back to ISO 8601 display dates (or find a way to parse a locale string).

Related branches

Michael Terry (mterry) wrote :

OK. desrt informs me that we can get what "%x" means by calling nl_langinfo (D_FMT). But that would still only give us field names. We'd still have to write a parser to cover a lot of various cases.

And apparently some of the characters might be translated when we display in locale format. So we'd have to parse hindi numbers too. (needs confirmation)

This might not be worth the effort to get right. I'm personally advocating reverting the commit and using ISO 8601 dates.

Changed in indicator-datetime (Ubuntu):
assignee: nobody → Matthew Paul Thomas (mpt)
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:indicator-datetime at revision 210, scheduled for release in indicator-datetime, milestone 13.04.0

Changed in indicator-datetime:
status: New → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package indicator-datetime - 12.10.3daily13.03.07-0ubuntu1

indicator-datetime (12.10.3daily13.03.07-0ubuntu1) raring; urgency=low

  [ Michael Terry ]
  * Manually editing date field results in bogus date (LP: #1149696)

  [ Automatic PS uploader ]
  * Automatic snapshot from revision 210
 -- Automatic PS uploader <email address hidden> Thu, 07 Mar 2013 02:01:22 +0000

Changed in indicator-datetime (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers