Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#1003 closed defect (fixed)

Null or blank dates are not handled reasonably by SortableTable

Reported by: [email protected] Owned by: Tom Trenka
Priority: high Milestone:
Component: Widgets Version: 0.3
Keywords: SortableTable Date null missing Cc:
Blocked By: Blocking:


I consider it a defect, you may consider it an enhancement, but the SortableTable? should handle null or blank (missing) values in a Date field in some consistent way, and display these values as a blank. In the current implementation of parseData and parseTable, the Date constructor is called and the default (i.e. Today) is returned.

I suggest that the "null/missing Date represented as a blank" use case is much more common than the need to generate a "Today" (actually "Now") Date value from a null or blank.

SortableTable? methods parseData and parseTable will have to be modified to skip parsing for null or blank Date column values and must be modified to return "" when passed a null or blank object. I haven't looked into it in detail, but sorting on Date fields seems to work fine for missing values with the above patches --- The missing values sort after (greater than) any Date value, although there could be two different preferences about what the default value should be for sorting --- whether a missing date is "before" all other dates, or "after".

I can provide a patch if you'd like, but the required changes are pretty straightforward.

Change History (4)

comment:1 Changed 15 years ago by [email protected]

I meant parseDataFromTable, not parseTable --- in src/widget/html/SortableTable.js

comment:2 Changed 15 years ago by Tom Trenka

Owner: changed from anonymous to Tom Trenka

Will deal with when I do the rewrite.

comment:3 Changed 15 years ago by Tom Trenka

Resolution: fixed
Status: newclosed

This should be handled fine within the replacement widget for Sortable called FilteringTable?.

comment:4 Changed 14 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.