I am using tablesorter plugin to sort my tables in an MVC .NET App. Most of my columns are strings and I\'m having no problems with them. Neither with the numeric ones. The thin
http://mottie.github.io/tablesorter/docs/
Set the date format. Here are the available options. (Modified v2.0.23).
In previous versions, this option was set as "us", "uk" or "dd/mm/yy". This option was modified to better fit needed date formats. It will only work with four digit years!
The sorter should be set to "shortDate" and the date format can be set in the "dateFormat" option or set for a specific columns within the "headers" option. See the demo page to see it working.
$(function(){
$("table").tablesorter({
dateFormat : "mmddyyyy", // default date format
// or to change the format for specific columns,
// add the dateFormat to the headers option:
headers: {
0: { sorter: "shortDate" }, // "shortDate" with the default dateFormat above
1: { sorter: "shortDate", dateFormat: "ddmmyyyy" }, // day first format
2: { sorter: "shortDate", dateFormat: "yyyymmdd" } // year first format
}
});
});
Individual columns can be modified by adding the following (they all do the same thing), set in order of priority (Modified v2.3.1):
In my case I have used
$("#myTable").tablesorter({dateFormat: "uk"})
for the version.