Divide the date string by the date, and then convert it to milliseconds. Let tablesorter sort the column as numeric.
$.tablesorter.addParser({
id: 'my_date_column',
is: function(s) {
return false;
},
format: function(s) {
var timeInMillis = new Date.parse(s);
return timeInMillis;
},
type: 'numeric'
});
$(function() {
$("table").tablesorter({
headers: {
6: {
sorter:'my_date_column'
}
}
});
});
If you are having problems with Date.parse, see my answer to this question .
source
share