DataTable date filter function not working on Chrome for mobile
DataTable date filter function not working on Chrome for mobile
Hello all,
i'm having a strange issue:
this function is working perfectly on desktop:
$.fn.dataTableExt.afnFiltering.push(
function( oSettings, aData, iDataIndex ) {
var iFini = document.getElementById('date_min').value;
var iFfin = document.getElementById('date_max').value;
var iStartDateCol = 3;
var iEndDateCol = 3;
iFini=iFini.substring(0,4) + iFini.substring(5,7)+ iFini.substring(8,10);
iFfin=iFfin.substring(0,4) + iFfin.substring(5,7)+ iFfin.substring(8,10);
var datofini=aData[iStartDateCol].substring(0,4) + aData[iStartDateCol].substring(5,7)+ aData[iStartDateCol].substring(8,10);
var datoffin=aData[iEndDateCol].substring(0,4) + aData[iEndDateCol].substring(5,7)+ aData[iEndDateCol].substring(8,10);
if ( iFini === "" && iFfin === "" )
{
return true;
}
else if ( iFini <= datofini && iFfin === "")
{
return true;
}
else if ( iFfin >= datoffin && iFini === "")
{
return true;
}
else if (iFini <= datofini && iFfin >= datoffin)
{
return true;
}
return false;
}
);
But for some reason when i try to filter the data table on Mobile (android 7 - latest chrome version) the filter is not working.
These are my includes:
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.16/js/dataTables.bootstrap.min.js"></script>
Can you think of any reason why?