Sorting by dates in Plone tables
This was originally posted on blogger here.
January 30, 1991 April 01, 2007 March 15, 2000 July 30, 2000
Now a user clicks on the dates column and you've got problems:
April 01, 2007 January 30, 1991 July 30, 2000 March 15, 2000
19910130 January 30, 1991 20070401 April 01, 2007 20000315 March 15, 2000 20000730 July 30, 2000
As you can see, sorts will be accurate (albeit ugly). The way to fix the ugliness is to put a span around the ugly part and give it a style of 'display:none;'.
But why not just use the unformatted date like 2000/01/01 instead of a format without slashes?
2000/03/15 March 15, 2000 = 44 March 15, 2000 2000/07/30 July 30, 2000 = 7 July 30, 2000
Hence you see the mad purpose of my fix and also what happens with loosely typed languages if you are not careful.