From dd72b81a06d26b9c905311a1f4d3d7e86fdbb7e4 Mon Sep 17 00:00:00 2001 From: Andrew Isherwood Date: Wed, 6 Jun 2018 10:45:44 +0100 Subject: [PATCH] Bug 20600: (follow-up) Fix filtering There was a bug whereby filtering by date would fail if the selected date syspref was set to dmydot or metric. Rather than use the display date value, We now use the non-display date value that is always in a predictable ISO8601 format to construct the Date objects used for comparison. Signed-off-by: Owen Leonard --- koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt index bc51a95..b8c2707 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt @@ -387,7 +387,7 @@ { // Hide the two date columns we use just for sorting 'aTargets': [ 'placed', 'updated' ], 'bVisible': false, - 'bSearchable': false + 'bSearchable': true }, { // When sorting 'placed', we want to use the // unformatted column @@ -428,12 +428,13 @@ // Custom date range filtering $.fn.dataTable.ext.search.push(function(settings, data, dataIndex) { + console.log(data); var placedStart = $('#illfilter_dateplaced_start').datepicker('getDate'); var placedEnd = $('#illfilter_dateplaced_end').datepicker('getDate'); var modifiedStart = $('#illfilter_datemodified_start').datepicker('getDate'); var modifiedEnd = $('#illfilter_datemodified_end').datepicker('getDate'); - var rowPlaced = data[8] ? new Date(data[8]) : null; - var rowModified = data[10] ? new Date(data[10]) : null; + var rowPlaced = data[7] ? new Date(data[7]) : null; + var rowModified = data[9] ? new Date(data[9]) : null; var placedPassed = true; var modifiedPassed = true; if (placedStart && rowPlaced && rowPlaced < placedStart) { -- 2.1.4