Item8097: PATCH Make ISO date sorting work

pencil
Priority: Normal
Current State: No Action Required
Released In:
Target Release:
Applies To: Extension
Component: TablePlugin
Branches:
Reported By: Foswiki:Main.UlrichSpoerlein
Waiting For:
Last Change By: MichaelDaum
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 smile

-- 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

ItemTemplate edit

Summary PATCH Make ISO date sorting work
ReportedBy Foswiki:Main.UlrichSpoerlein
Codebase 1.0.5, 1.0.4
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component TablePlugin
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
ReleasedIn
I Attachment Action Size Date Who Comment
tableplugin-core-2.diffdiff tableplugin-core-2.diff manage 825 bytes 28 May 2009 - 09:47 KerstinPuschke Improved Patch to make TablePlugin DTRT with ISO and German dates
tableplugin-core.diffdiff tableplugin-core.diff manage 817 bytes 04 Apr 2009 - 07:35 UlrichSpoerlein Patch to make TablePlugin DTRT with ISO and German dates
Topic revision: r8 - 04 Jun 2009, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy