taskwarrior icon indicating copy to clipboard operation
taskwarrior copied to clipboard

[TW-1618] Taskwarrior incorrectly interprets an ISO-8601 date containing only a year

Open taskwarrior opened this issue 7 years ago • 5 comments

Jeremy John Reeder on 2015-05-13T21:42:22Z says:

"2017" is a valid ISO-8601 date, although it's not listed among [Taskwarrior's supported date formats|http://taskwarrior.org/docs/dates.html]. Taskwarrior should either accept that date with the correct ISO-8601 interpretation or produce an error message. I'd prefer correct interpretation over an error message, but I'd accept either. Instead, Taskwarrior silently accepts the date with an unreasonable interpretation. That is, when I set the "wait" date for a task to "2017", it is interpreted as the crazy "1969-12-31T17:33:37" rather than the sane "2017-01-01T00:00:00" that I actually mean.

taskwarrior avatar Feb 14 '18 13:02 taskwarrior

Migrated metadata:

Created: 2015-05-13T21:42:22Z
Modified: 2017-01-16T17:34:35Z

taskwarrior avatar Feb 14 '18 13:02 taskwarrior

Paul Beckingham on 2015-05-14T01:45:06Z says:

2017 being interpreted as simply a number of seconds. From your example: 1969-12-31T17:33:37

$ task calc 2017s
PT33M37S

taskwarrior avatar Feb 14 '18 13:02 taskwarrior

Paul Beckingham on 2015-07-19T19:15:58Z says:

Not a bug.

taskwarrior avatar Feb 14 '18 13:02 taskwarrior

Jeremy John Reeder on 2015-07-20T01:07:50Z says:

How is this not a bug? If I want 2017 seconds, I'll enter "2017s". If I want the year 2017, I'll enter the valid ISO-8601 date "2017". What value is there in interpreting this as a number of seconds when the seconds unit was not specified?

taskwarrior avatar Feb 14 '18 13:02 taskwarrior

Paul Beckingham on 2015-07-22T17:10:13Z says:

Reopening. Will discuss soon.

taskwarrior avatar Feb 14 '18 13:02 taskwarrior