Reputation: 33
I am using jquery tablesorter to add sorting to a table. I'm having issues sorting a column with only hh:mm:ss in it. The SQL query producing this data is basically a now() - datetime field then in SQL I format it to hh:mm:ss. When sorting the column tablesorter does not appear to recognize the time format and as a result does not sort it correctly. Is there a way to correct this so that the times are sorted correctly?
Sorting Example: 53:47:57 53:33:34 530:54:38 52:12:14 52:07:58 526:21:35 51:53:41 51:53:26 51:41:34
Upvotes: 1
Views: 2783
Reputation: 86443
Tablesorter has a built-in time parser (missing docs), try this:
$("table").tablesorter({
headers: {
0: { sorter: 'time'}
}
});
Upvotes: 4
Reputation: 40338
$("#tableId").tablesorter({
headers: { column Number: { sorter: 'shortDate'} }
});
Upvotes: 0