Opened 16 years ago

Closed 16 years ago

#1736 closed defect (wontfix)

SortableTable: parsing dates can be incorrect.

Reported by: guest Owned by: Tom Trenka
Priority: high Milestone: 0.9
Component: Widgets Version: 0.4
Keywords: SortableTable, date Cc:
Blocked By: Blocking:


The SortableTable? has a bug in the parsing of the "Date" columns. In fact when you pick the value of a column (for exemple "10/08/2006"), the string is converted in a Date without using the FORMAT attribute. But when you write the table, the Date object is converted into String using the FORMAT attribute. In the method 'parseDataFromTable' on row 310, you have the code:

if(type == String){
} else {
   if (val!=null){
       o[field]=new type(val);
   } else {
       o[field]=new type();	
       //let it use the default.

So if the type is 'Date' the string is converted into Date with a 'new Date(val)'. I think you must here use the with the format attribute to parse the string correctly.

Change History (3)

comment:1 Changed 16 years ago by bill

Milestone: 0.5
Owner: changed from bill to Tom Trenka

SortableTable? is deprecated so this won't be fixed, but assigning to Tom just in case the same problem exists in FilterTable? (sp?)

comment:2 Changed 16 years ago by Tom Trenka

Priority: highnormal
Summary: SortableTable on columns of Date typeSortableTable: parsing dates can be incorrect.

Will double check in Filtering but IIRC Adam set it up to use the localization stuff. The original (Sortable) uses the native JS date parsing to figure out what the value of the column is.

comment:3 Changed 16 years ago by Tom Trenka

Resolution: wontfix
Status: newclosed

Closing this with the removal of Sortable from the codebase, and with the filing of the same basic bug on Filtering.

Note: See TracTickets for help on using tickets.