$.fn.dataTable.moment=function(n,t){var i=$.fn.dataTable.ext.type;i.detect.unshift(function(i){return moment(i,n,t,!0).isValid()?"moment-"+n:null});i.order["moment-"+n+"-pre"]=function(i){return moment(i,n,t,!0).unix()}};var minDate,maxDate;$.fn.dataTable.ext.search.push(function(n,t){var i=minDate.val(),r=maxDate.val();return(date=new Date(t[5]),i===null&&r===null||i===null&&date<=r||i<=date&&r===null||i<=date&&date<=r)?!0:!1});$(document).ready(function(){minDate=new DateTime($("#datepicker_from"),{format:"MM/DD/YYYY"});maxDate=new DateTime($("#datepicker_to"),{format:"MM/DD/YYYY"});$.fn.dataTable.moment("MM/DD/YYYY");var n=$("#MissingPersonsClearingHouse").DataTable({dom:"Blfrtip",fixedHeader:!0,responsive:!1,order:[[5,"desc"]],columnDefs:[{targets:5,render:function(n){return moment(n).isValid()?moment(n).format("MM/DD/YYYY"):"-"}},{visible:!0,targets:[0,6]}],buttons:[{extend:"print",messageTop:"Exported on "+(new Date).toISOString().slice(0,10)},{extend:"copyHtml5",messageTop:"Exported on "+(new Date).toISOString().slice(0,10)},{extend:"excelHtml5",messageTop:"Exported on "+(new Date).toISOString().slice(0,10)},"csvHtml5",{extend:"pdfHtml5",orientation:"landscape",messageTop:function(){return"Printed on "+(new Date).toISOString().slice(0,10)}}],select:!0});$("#datepicker_from, #datepicker_to").on("keydown",function(n){n.key=="Enter"&&(n.stopPropagation(),n.preventDefault())});$("#datepicker_from, #datepicker_to").on("keyup",function(){n.draw()});$("#datepicker_from, #datepicker_to").on("change",function(){n.draw()})})