How to add date range filter..
like From-To .
I got working regular search and pagination, etc.. But I dont know how to make date range filter.
I'm using Datatables 1.10.11 version.
My code:
var oTable;
function callFilesTable($sPaginationType, $bPaginate, $bFilter, $iDisplayLength, $fnSortcol, $fnSortdir){
$.extend($.fn.dataTableExt.oStdClasses, {
sSortAsc : 'header headerSortDown',
sSortDesc : 'header headerSortUp',
sSortable : 'header'
});
oTable = $('#sort').DataTable({
dom : '<"table-controls-top"fl>rt<"table-controls-bottom"ip>',
pagingType : $sPaginationType,
paging : $bPaginate,
searching : $bFilter,
pageLength : $iDisplayLength,
order : [ [$fnSortcol, $fnSortdir] ],
columnDefs : [
{
width : '50%',
targets : [ 2 ],
orderable : true,
searchable : true,
type : 'natural'
},
{
width : '10%',
targets : [ 3 ],
orderable : true
},
{
width : '20%',
targets : [ 4 ],
orderable : true
},
{
targets : ['_all'],
orderable : false,
searchable : false
}
],
language : paginationTemplate,
drawCallback : function() {
checkSelecta();
placeHolderheight();
// hide pagination if we have only one page
var api = this.api();
var pageinfo = api.page.info();
var paginateRow = $(this).parent().find('.dataTables_paginate');
if (pageinfo.recordsDisplay <= api.page.len()) {
paginateRow.css('display', 'none');
} else {
paginateRow.css('display', 'block');
}
}
});
oTable.on( 'length.dt', function ( e, settings, len ) {
updateSession({ iDisplayLength: len });
});
}
And I'm using NaturalSort 0.7 version.