Please do not mark as duplicate as I haven't find solutions anywhere.
Following line is not working to sort date and time together in DataTable
.
Secondly, I have used following code to make sorting working but it doesn't:
$.fn.dataTable.moment('HH:mm dd/mm/YY');
//$.fn.dataTable.moment( 'DD-MM-YYYY HH:mm' );
and for DataTable
initialization I have used following code:
$('.dataTable').DataTable({
ordering: true,
paging: true,
searching: true,
dom: 'Bftripl',
buttons: [
'excelHtml5',
'csvHtml5',
'pdfHtml5'
],
"columnDefs": [
//{ "type": "date-euro", targets: 1 }
//{ "sType": "date-uk", targets: 1 }
]
});
I have added file : datetime-moment.js
None of the code working for sorting out the date column
, so please anybody help or provide example for it on jsFiddle.
Thanks Friends in advanced:)
For Anan your code gives me following output: after using your updated code but can't pass data as I am feeding data into table using php....
$.fn.dataTable.moment( 'HH:mm DD/MM/YYYY' );
$('.dataTable').DataTable({
ordering: true,
paging: true,
searching: true,
dom: 'Bftripl',
buttons: [
'excelHtml5',
'csvHtml5',
'pdfHtml5'
]
});