Item8097: PATCH Make ISO date sorting work
Priority: Normal
Current State: No Action Required
Released In:
Target Release:
The
TablePlugin is guessing the table field values using a heuristic to determine if the value looks like a date. If the regexps match, it will convert the field to a "real" date value for sorting.
The regexps in question are missing one for the non-ambiguous ISO date format, ie YYYY-MM-DD and while at it, I also added the usual date format used in Germany, ie. DD.MM.YYYY.
There should be another regexp at the top, that matches the dateformat as specified in
LocalSite.cfg ...
Let see, if I can attach the patch to this topic, I'm new to Foswiki
--
UlrichSpoerlein - 04 Apr 2009
I can confirm the issue for 1.0.5., sorting ISO dates fails.
Ulrich's patch works fine - thank you for contributing it - , except one of the dates happens to be in December. This is because the TablePlugin uses 0..11 as the range for months. I've attached an improved version of the patch that shifts the months accordingly.
--
KerstinPuschke - 28 May 2009
in
Item8173,
MichaelDaum updated the table sorting code to use
Foswiki::Time, so a variety of dates are now supported. from the docs:
Handles the following formats:
Default Foswiki format
* 31 Dec 2001 - 23:59
Foswiki format without time (defaults to 00:00)
* 31 Dec 2001
Date separated by '/', '.' or '-', time with '.' or ':'
Date and time separated by ' ', '.' and/or '-'
* 2001/12/31 23:59:59
* 2001.12.31.23.59.59
* 2001/12/31 23:59
* 2001.12.31.23.59
* 2001-12-31 23:59
* 2001-12-31 - 23:59
* 2009-1-12
* 2009-1
* 2009
ISO format
* 2001-12-31T23:59:59
* 2001-12-31T
ISO dates may have a timezone specifier, either Z or a signed difference
in hh:mm format. For example:
* 2001-12-31T23:59:59+01:00
* 2001-12-31T23:59Z
The default timezone is Z, unless $defaultLocal is true in which case
the local timezone will be assumed.
can we close this task?
--
WillNorris - 03 Jun 2009
I think so, if there are bugs in it, it is a different bug then, so we'd have to see. Has the code been released yet?
--
UlrichSpoerlein - 04 Jun 2009
Not yet. It has been checked in to svn stable and trunk. Unfortunately it revealed a bug in Foswiki::Time::praseTime as well.
Fortunately this is fixable with a one-liner (almost):
distro:53a9dc0711a8
So basically this bug item can be closed now with no action required as far as I can see.
--
MichaelDaum - 04 Jun 2009