How To Sort The Datetime Field In Datatable Plugin In PHP?
I'm used to sort the date and time field in datatable plugin.but it not working it sort in the order of 9,8,7,...12,11,10. If I'm use some custom code for sorting I works but it is
Solution 1:
Finally i got the answer thanks you for all for your comments
jQuery.fn.dataTableExt.oSort['uk_date-pre'] = function(a) {
var a = a.split('m')[0];
if(a == '-'){
return -1;
}
a=a+'m';
a = a.slice(0, -2) + ' ' + a.slice(-2);
var date = Date.parse(a);
return typeof date === 'number' ? date : -1;
}
Post a Comment for "How To Sort The Datetime Field In Datatable Plugin In PHP?"