NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use
trunk.foswiki.org to view this page for some minimal testing.
Use
Item9693 for docu changes for 1.2 and 2.0.
Item8700: Sorting mixed data types gives unexpected results
| Priority: |
CurrentState: |
AppliesTo: |
Component: |
WaitingFor: |
| Normal |
Closed |
Extension |
TablePlugin |
|
Test case:
Dates |
| 18-Dec-2001 |
| 19-Dec-2001 - 23:59 |
| 20 Dec 2001 - 23:59 |
| 21 Dec 2001 |
| 2001-12-22T23:59:59+01:00 |
| 2001-12-23T23:59Z |
| 2001-12-24T |
| 2001-12-25T23:59:59 |
| 2001.12.26.23.59.59 |
| 2001/12/27 23:59:59 |
| 2001/12/28 23:59 |
| 2001-12-29 - 23:59 |
| 2001.12.30.23.59 |
| 2001-12-31 23:59 |
| 2009-1 |
| 2009-1-12 |
| 2009 |
This is because
2009 is considered a number, not a date.
We also have problems sorting empty cells:
number of things |
| |
| -1.1 thingies |
| 1 thingy |
| 2 thingies |
| 2.0 thingies |
| 9.99 thingies |
| 10.1 thingies |
| 20 thingies |
and mixed numbers and text:
This is because the code now assumes a column type to sort on. If a column type is numbers, an empty cell invalidates the column type and further processing is stopped and sorted is done with column type of
UNDEFINED.
I have removed the column type concept to just sort on the value, whether it is text, a number, empty or a date.
If you like to test this on your installation, attached is the trunk version of the plugin that - should - work on Foswiki 1.0.9.
--
ArthurClemens - 13 Mar 2010
I tried the attached version; it's a nice solution to sort mixed type columns, but I don't know if sorting of mixed number-and-date columns will ever be satisfactory because common values like '2009' and '2001.12' are ambiguous and because there's no expectation for how numbers and dates order.
--
MegCrocker - 16 Mar 2010