Ticket #2383 (closed defect: fixed)
Date on add/edit resource breaks if offset is specified
Reported by: | icmurray | Owned by: | icmurray |
---|---|---|---|
Priority: | minor | Milestone: | ckan-sprint-2012-05-29 |
Component: | ckan | Keywords: | [0.5d] |
Cc: | Repository: | ckan | |
Theme: | none |
Description
Change History
comment:1 Changed 2 years ago by icmurray
- Keywords [0.5d] added
- Milestone changed from ckan-sprint-2012-05-15 to current-ckan-sprint-2012-05-29
comment:2 Changed 2 years ago by icmurray
This helper function won't parse UTC offset if passed a UTC offset as "+01:00"; but incorrectly parses the UTC offset "+0100" as 100 microseconds.
Resolution:
- I've decided to keep the behaviour of not parsing UTC offsets because we currently don't store timezone information in the database; and I think that either dropping the tzinfo, or adjusting for it would appear to be "magic behaviour" from the user's perspective. Also, as this is a helper function, I think it makes sense to keep the behaviour as is, even if it's slightly non-standard.
This fix [1] maintains all the old non-ISO behaviour:
- not allowing UTC offset to be specified.
- arbitrary delimiters between date and time values.
- microsecond precision.
But won't parse "+0100" as microsecond precision.
I tried using a couple of python modules for parsing date strings; but none maintained the same behaviour.
[1] https://github.com/okfn/ckan/commit/d6c9e48f8df5e926abd3fb1a1607f4f5a30075b4
Note: See
TracTickets for help on using
tickets.