I want to create a date range filter that can be applied to a number of datatables. The problem I am having is even though I am passing
in my aaData value as an array of objects by the time I get to the filter function it is in an array. This wont work because the index of the date value in the array is different in the various dataTables throughout my application and I would much rather be able to do it via dot notation on an attribute something like this.
in my aaData value as an array of objects by the time I get to the filter function it is in an array. This wont work because the index of the date value in the array is different in the various dataTables throughout my application and I would much rather be able to do it via dot notation on an attribute something like this.
$.fn.dataTableExt.afnFiltering.push( function( oSettings, aData, iDataIndex ) { var iMin = document.getElementById('start-datepicker').value; var iMax = document.getElementById('end-datepicker').value; // Create Minimum Date Object var iMinDate = new Date(iMin); // Create Maximum Date Object var iMaxDate = new Date(iMax); // Create Date Column Object var iDateStr = aData.date; var iDate = new Date(iDateStr); if ( iMinDate < iDate && iDate < iMaxDate ) { return true; } return false; } );