Check out the example parsers page, it shows you how to create a custom parser. You can parse dates like that with new Date(date)
or Date.parse(date)
. I don't have the means to test it, but something like this should work:
// add parser through the tablesorter addParser method
$.tablesorter.addParser({
// set a unique id
id: 'ddMMMyy',
is: function(s) {
// return false so this parser is not auto detected
return false;
},
format: function(s) {
// parse the string as a date and return it as a number
return +new Date(s);
},
// set type, either numeric or text
type: 'numeric'
});
All that's left for you to do is specify the sorting method using the headers
option:
$(document).ready(function() {
$("dataTable").tablesorter({
headers: {
6: { // <-- replace 6 with the zero-based index of your column
sorter:'ddMMMyy'
}
}
});
});