While bootstrap datetimepicker does work (https://eonasdan.github.io/bootstrap-datetimepicker/), my datatable does not filter. When I insert the dates manually without implementing datetimepicker, the datatable filter.
I have 4 fields that are to filter my datatables, namely, min/max (minimum ID number and maximum ID number) and fini/ffin (start date and finish date of when the record was created).
Min/max work fine and as expect.
Fini/ffini work fine when I do NOT attach datetimepicker to the field (eg I manually input the date like 2016-12-01 and 2016-12-01). When I attach the datatimepicker like below the they do NOT work:
$(document).ready(function() {
var table = $('#mytable').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print', 'colvis'
],
colReorder: true,
keys: true,
} );
// add bootstrap datepicker. If below is removed,
// it works if I manually insert the dates
$("#fini").datetimepicker({
format: 'YYYY-MM-DD'
});
$("#ffin").datetimepicker({
format: 'YYYY-MM-DD'
} );
// Event listener to the two range filtering
// inputs to redraw on input
$('#min, #max').keyup( function() {
table.draw();
} );
$('#fini').keyup( function() {
table.draw();
} );
$('#ffin').keyup( function() {
table.draw();
} );
} );