:: Forum >> Version 1 >>

Date format for effective sorting?

I'm having some trouble getting dates to sort properly.

I'm using the date format of mm/dd/yyyy but it seems to sort by the mm/dd only, I cannot get the year to be taken into consideration when sorting by date.

Example: 01/09/2004
01/10/2003
01/12/2005
02/17/2004
02/22/2003

Or do I need to declare a date format in the code itself?

Thanks.

Michael
Monday, April 11, 2005
I have not tried this yet so perhaps someone familiar with the sort code could confirm or correct but I am considering trying something like this when I want a sort value different from the display value:

<!-- sort value -->display value so your date cell contents would be
<!-- 2004/09/01 -->01/09/2004

Assuming the sort works on the entire cell contents this should work. Although with a little bit of a download performance hit.

Ken Gregg
Monday, April 11, 2005
Maybe this can help:

http://www.activewidgets.com/grid.howto.fix/sort-empty-cells.html

Basically grid uses data/text property for display and data/value for sorting. By default data/value = data/text and sorting procedure tries to guess if the value is string or number. It works well only in most simple cases, othervise you have to either send both text and value arrays or provide function which converts text to value (or value to text).
Alex (ActiveWidgets)
Monday, April 11, 2005



This topic is archived.

Back to support forum

Forum search