Skip to content Skip to sidebar Skip to footer

Filter Datatable With Date Range

I want to integrate datarange picker plugin into datatables and I write: $(document).ready(function() { $(function() { var start = moment('2017-01-01 12:34:16'); var end

Solution 1:

The main issue is your date comparisons

var start = picker.startDate.format('YYYY-MM-DD');
var end = picker.endDate.format('YYYY-MM-DD');

Should be:

var start = picker.startDate;
var end = picker.endDate;

Then you also end up with a problem that your data is getting removed completely out of the search when you filter so you need this after you draw your table

$.fn.dataTable.ext.search.pop();

https://jsfiddle.net/ankepv5v/79/


Post a Comment for "Filter Datatable With Date Range"