I\'m trying to sort dates in my datatable like DD/MM/YYYY
(day, month, year) .
I was following https://datatables.net/plug-ins/sorting/ .
but all the
Following Plasebo's example works, but in my case the MySQL DATE_FORMAT was sorting on month value, not entire date. My solution was to remove the DATE_FORMAT from my SQL statement.
$(document).ready(function() {
$.fn.dataTable.moment('DD/MM/YY');
$('.happyTable').DataTable({
"ordering": true,
"order": [[ 1, "desc" ]],
});
});
DATE_FORMAT(date,'%m/%d/%Y')
"2003-12-30 00:00:00" results in "12/30/2003" but sorts on month value.