=== modified file 'CHANGELOG' --- CHANGELOG 2012-09-08 08:10:51 +0000 +++ CHANGELOG 2012-10-09 02:50:56 +0000 @@ -1,3 +1,5 @@ +2012-0?-?? Getting Things GNOME! 0.4 + * Fix for bug-1062659 (allow locale date format), by Nimit Shah 2012-0?-?? Getting Things GNOME! 0.3 * Hide tasks with due date someday, #931376 * New Date class by Paul Kishimoto and Izidor MatuĊĦov === modified file 'GTG/core/firstrun_tasks.py' --- GTG/core/firstrun_tasks.py 2012-07-23 14:40:52 +0000 +++ GTG/core/firstrun_tasks.py 2012-10-09 18:28:12 +0000 @@ -260,7 +260,7 @@ "defer:date\n" "\n" "Using this you can apply a due date or a defer date. Dates can be " -"formated as yyyy-mm-dd (for example 2012-04-01) or yyyymmdd (20120401) " +"formated as per your locale or yyyy-mm-dd (for example 2012-04-01) or yyyymmdd (20120401) " "or mmdd (0401 - the year being implicitly the current one) or today, " "tomorrow or a weekday name (due:monday means due next Monday). Dates " "which are added in this way will not appear in the task title.\n" === modified file 'GTG/tools/dates.py' --- GTG/tools/dates.py 2012-05-23 08:55:31 +0000 +++ GTG/tools/dates.py 2012-10-09 18:50:01 +0000 @@ -69,6 +69,8 @@ # ISO 8601 date format ISODATE = '%Y-%m-%d' +#get date format from locale +locale_format = locale.nl_langinfo(locale.D_FMT) def convert_datetime_to_date(aday): @@ -84,7 +86,8 @@ can be constructed with: - the fuzzy strings 'now', 'soon', '' (no date, default), or 'someday' - a string containing an ISO format date: YYYY-MM-DD, or - - a datetime.date or Date instance. + - a datetime.date or Date instance, or + - a string containing a locale format date. """ _real_date = None _fuzzy = None @@ -104,15 +107,20 @@ self._fuzzy = value._fuzzy # pylint: disable-msg=W0212 elif isinstance(value, str) or isinstance(value, unicode): try: - da_ti = datetime.datetime.strptime(value, ISODATE).date() + da_ti = datetime.datetime.strptime(value, locale_format).date() self._real_date = convert_datetime_to_date(da_ti) except ValueError: - # it must be a fuzzy date try: - value = str(value.lower()) - self._parse_init_value(LOOKUP[value]) - except KeyError: - raise ValueError("Unknown value for date: '%s'" % value) + #allow both locale format and ISO format + da_ti = datetime.datetime.strptime(value, ISODATE).date() + self._real_date = convert_datetime_to_date(da_ti) + except ValueError: + # it must be a fuzzy date + try: + value = str(value.lower()) + self._parse_init_value(LOOKUP[value]) + except KeyError: + raise ValueError("Unknown value for date: '%s'" % value) elif isinstance(value, int): self._fuzzy = value else: === modified file 'doc/userdoc/C/gtg-quickadd-dates.page' --- doc/userdoc/C/gtg-quickadd-dates.page 2012-07-09 15:18:39 +0000 +++ doc/userdoc/C/gtg-quickadd-dates.page 2012-10-09 11:20:37 +0000 @@ -29,7 +29,7 @@

defer:date

-

This way you can apply a due date or a defer date. Dates can be formatted as yyyy-mm-dd (for example 2012-04-01) or yyyymmdd (20120401) or mmdd (0401 - the year being implicitly the current one) or today, tomorrow or a weekday name (due:monday means due next Monday). Dates which are added in this way will not appear in the task title.

+

This way you can apply a due date or a defer date. Dates can be formatted as dates in your locale or yyyy-mm-dd (for example 2012-04-01) or yyyymmdd (20120401) or mmdd (0401 - the year being implicitly the current one) or today, tomorrow or a weekday name (due:monday means due next Monday). Dates which are added in this way will not appear in the task title.

Examples