fixed store order filder by date

This commit is contained in:
franknstayn
2019-11-13 16:25:28 +08:00
parent db0a359e56
commit 84f84f6288
2 changed files with 6 additions and 5 deletions

View File

@@ -640,10 +640,10 @@
$( document ).ready(function() {
$.fn.dataTable.ext.search.push(
function (settings, data, dataIndex) {
var min = $('#min').datepicker("getDate");
var max = $('#max').datepicker("getDate");
var startDate = new Date(data[4]);
var startDate = new Date(data[9]);
if (min == null && max == null) { return true; }
if (min == null && startDate <= max) { return true;}
if(max == null && startDate >= min) {return true;}
@@ -654,6 +654,7 @@
$("#min").datepicker({ onSelect: function () { table.draw(); }, changeMonth: true, changeYear: true });
$("#max").datepicker({ onSelect: function () { table.draw(); }, changeMonth: true, changeYear: true });
var table = $('#tbl_store_orders').DataTable({
scrollX: true,
dom: 'Bfrtip',
@@ -679,7 +680,8 @@
title : function() {
return "ORDER REPORTS";
}
}
}
//,
// {
// extend: 'pdf',
@@ -711,7 +713,7 @@
],
columnDefs: [
{ targets: 9, type: 'date', visible: false },
{ targets: 19, type: 'date' }
{ targets: 9, type: 'date' }
],
});