Item8700: Sorting mixed data types gives unexpected results

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Extension TablePlugin  
Test case:

Dates
2001/12/27 23:59:59
2001.12.26.23.59.59
2001/12/28 23:59
2001.12.30.23.59
2001-12-31 23:59
2001-12-29 - 23:59
2009-1-12
2009-1
2009
2001-12-25T23:59:59
2001-12-24T
2001-12-22T23:59:59+01:00
2001-12-23T23:59Z
21 Dec 2001
18-Dec-2001
20 Dec 2001 - 23:59
19-Dec-2001 - 23:59

This is because 2009 is considered a number, not a date.

We also have problems sorting empty cells:

number of things
1 thingy
10.1 thingies
-1.1 thingies
9.99 thingies
2 thingies
2.0 thingies
 
20 thingies

and mixed numbers and text:

mostly numbers
-1
0
1
ls -al
 
3

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
 

ItemTemplate edit

Summary Sorting mixed data types gives unexpected results
ReportedBy ArthurClemens
Codebase trunk
SVN Range
AppliesTo Extension
Component TablePlugin
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:ca57d89dbb6d
TargetRelease minor
ReleasedIn 1.1.0

I Attachment Action Size Date Who Comment
TablePlugin.zipzip TablePlugin.zip manage 27.1 K 13 Mar 2010 - 16:20 ArthurClemens TablePlugin version 1.122
Topic revision: r4 - 04 Oct 2010, KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License