0
$.fn.dataTable.ext.search.push(
function( settings, data, dataIndex ) {
var min = $('#min-date').val() ? $('#min-date').val().split('/') : null;
var max = $('#max-date').val() ? $('#max-date').val().split('/') : null;
if(max && min){
max = moment(max[2] + '-' + max[1] + '-' + max[0])
min = moment(min[2] + '-' + min[1] + '-' + min[0])
}
var createdAt = data[4].substring(0,10); // Our date column in the table
createdAt = createdAt.split('/')
dataCriacao = createdAt[2] + '-' + createdAt[1] + '-' + createdAt[0]
if( (!max || !min) || moment(dataCriacao).isSameOrBefore(max) && moment(dataCriacao).isSameOrAfter(min)) {
return true
}
return false
}
);
Thanks a lot bro worked out !!!
– nepster85
For nothing! Hugs.
– Lucas Brogni