我正在使用Data Table DateTimePicker,问题是4月1日的数据库中有可用的记录。但是当我用来过滤4月1日至30日之间的数据时,它显示没有记录,但是当我用它来过滤3月31日到1之间的记录时,它可能会显示与4月1日相关的记录。我的代码是:
<script src="media/js/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="media/js/jquery.dataTables.min.js" type="text/javascript"></script>
<script src="media/js/jquery-ui.js" type="text/javascript"></script>
<script src="media/js/jquery.dataTables.columnFilter.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$.datepicker.regional[""].dateFormat = 'dd/mm/yy';
$.datepicker.setDefaults($.datepicker.regional['']);
$('#example').dataTable({
"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
/*
* Calculate the total market share for all browsers in this table (ie inc. outside
* the pagination)
*/
var iTotalMarket = 0;
for ( var i=0 ; i<aaData.length ; i++ )
{
iTotalMarket += aaData[i][11]*1;
}
/* Calculate the market share for browsers on this page */
var iPageMarket = 0;
for ( var i=iStart ; i<iEnd ; i++ )
{
iPageMarket += aaData[ aiDisplay[i] ][11]*1;
}
/* Modify the footer row to match what we want */
var nCells = nRow.getElementsByTagName('th');
nCells[1].innerHTML = parseInt(iPageMarket * 100)/100 +
' INR of ('+ parseInt(iTotalMarket * 100)/100 +' INR)';
},
"aoColumns": [
{ "sWidth": "200px" },
null,
null
]
} )
.columnFilter({ sPlaceHolder: "head:before",
aoColumns: [ { type: "hidden" },
{ type: "hidden" },
{ type: "hidden" },
{ type: "hidden" },
{ type: "hidden" },
{ type: "hidden" },
{ type: "hidden" },
{ type: "hidden" },
{ type: "hidden" },
{ type: "date-range", sRangeFormat: "From Date{from} To Date {to}" },
{ type: "hidden" },
{ type: "hidden" },
{ type: "hidden" }
]
});
});
</script>