我有关于数据表
的日期格式的问题07.01.2016 17:35
如果对于垫子来说就像它那样将日子视为月份和月份,但是如果来的话
14.01.2016 17:35
它看起来是真的我正在尝试制作日期范围但是,错误的日期来自表格如何解决它? 谢谢你的到来。
var minDateFilter;
var maxDateFilter;
$('#datepicker_from').click(function () {
$("#datepicker_from").datepicker("show");
});
$('#datepicker_to').click(function () {
$("#datepicker_to").datepicker("show");
});
$("#datepicker_from").datepicker({
"onSelect": function (date) {
minDateFilter = new Date(Date.parse(date).toString("yyyy/MM/dd")).getTime();
//alert(Date.parse(date).toString("yyyy/MM/dd"));
oTable.draw();
//alert(Date.parse(date).toString("yyyy/MM/dd"));
}
}).keyup(function () {
minDateFilter = new Date(Date.parse(this.value).toString("yyyy/MM/dd")).getTime();
oTable.draw();
});
$("#datepicker_to").datepicker({
"onSelect": function (date) {
maxDateFilter = new Date(Date.parse(date).toString("yyyy/MM/dd")).getTime();
oTable.draw();
}
}).keyup(function () {
maxDateFilter = new Date(Date.parse(this.value).toString("yyyy/MM/dd")).getTime();
oTable.draw();
});
$.fn.dataTableExt.afnFiltering.push(
function (oSettings, aData, iDataIndex) {
if (typeof aData._date == 'undefined') {
aData._date = new Date(Date.parse(aData[3]).toString("yyyy/MM/dd")).getTime();
//alert(Date.parse(aData[3]).toString("yyyy/MM/dd"));
}
if (minDateFilter && !isNaN(minDateFilter)) {
//alert(aData._date + "<" + minDateFilter);
if (aData._date < minDateFilter) {
return false;
}
}
if (maxDateFilter && !isNaN(maxDateFilter)) {
if (aData._date > maxDateFilter) {
return false;
}
}
return true;
}
);