Here is the code ..
$.fn.dataTableExt.oSort['us_date-asc'] = function (a, b) {
var x = new Date(a),
y = new Date(b);
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
};
$.fn.dataTableExt.oSort['us_date-desc'] = function (a, b) {
var x = new Date(a),
y = new Date(b);
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
};
var oTable = $('#example').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
//"bSortClasses": false,
"aoColumns": [
null, null,
{
"sType": "us_date"
},
null,
{
"bSortable": false
}],
"aaSorting": [
[2, "desc"]
]
});
Am using this code for the datatable to make the third column sortable. I want to display date in jun-06-2012 format .The sorting works fine when am using 06-06-2012 format... but sorting does not work(it works in chrome but not in other browsers) when month is represented alphabetically... How can i tackle this ? Any help will be appreciated