I faced the issue of sorting date column format(‘m/d/Y H:i A’) (index: 0) when there are multiple years in data, and the work around I came up with is to create a new hidden field with date format Y-m-d H:i:s and updated the code as below
$('#dataTables-example').DataTable({
'columnDefs': [
{ 'orderData':[1], 'targets': [0] },
{
'targets': [1],
'visible': false,
'searchable': false
},
],
"order": [[0, "asc"]],
"oLanguage": {
"sEmptyTable": "There are no transactions."
}
});
Top comments (0)