Foswiki on GitHub is open for business! Next release meeting: Monday September 29, 1300Z

Item2482: Improved documentation for date formats in TablePlugin

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Low Closed Extension TablePlugin  
If I have the following table

%TABLE{sort="on"}%
| *label* | *date* |
| docs | 08/29/2009 |
| docs | 12/08/2009 |
| docs | 01/28/2009 |
| docs | 01/27/2009 |

an ascending sort should show

| docs | 01/27/2009 |
| docs | 01/28/2009 |
| docs | 08/29/2009 |
| docs | 12/08/2009 |

It does not. Instead 01/28/2009 comes before 01/27/2009

  • screenshot - unexpected sort order:
    Item2482-ascending.png

  • screenshot - desceinding works as expected:
    Item2482-descending.png

-- VickiBrown - 08 Dec 2009

It looks like the documentation is wrong. TablePlugin uses the Foswiki::Time module. The code doc says:
Handles the following formats:

Default Foswiki format
   * 31 Dec 2001 - 23:59
   * 31-Dec-2001 - 23:59

Foswiki format without time (defaults to 00:00)
   * 31 Dec 2001
   * 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

So it is either:
  • dd Mmm yyyy
  • dd-Mmm-yyyy
  • yyyy-mm-dd
  • yyyy.mm.dd
  • yyyy/mm/dd

and not dd/mm/yyyy

I have improved the documentation.

-- ArthurClemens - 08 Dec 2009

Note also that we still have a sort bug Item8302 - in case someone sees this report and think it is the same.

As a note about the date format. 12/08/2010 means 12th of August in most countries in this world. It is only US to my knowledge that puts things upside-down. And Foswiki is an international project with no obvious reason to let the US way be the right way. For this reason we have chosen not to implement either way. Instead we encourage using formats we all agree on. All the formats supported leave no doubt. 2010.08.12 is 12th of August. If these ISO like formats confuses use the more human dd Mmm YYYY. This also works in USA and is quite natural.

-- KennethLavrsen - 05 Jan 2010

ItemTemplate edit

Summary Improved documentation for date formats in TablePlugin
ReportedBy VickiBrown
Codebase 1.0.8, trunk
SVN Range
AppliesTo Extension
Component TablePlugin
Priority Low
CurrentState Closed
WaitingFor
Checkins Foswikirev:5756
TargetRelease patch
ReleasedIn
Topic attachments
I Attachment Action Size Date Who Comment
Item2482-ascending.pngpng Item2482-ascending.png manage 10.7 K 08 Dec 2009 - 21:56 VickiBrown screenshot - unexpected sort order
Item2482-descending.pngpng Item2482-descending.png manage 10.6 K 08 Dec 2009 - 21:57 VickiBrown screenshot - desceinding works as expected
Topic revision: r9 - 17 Jan 2010, PaulHarvey
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License