From 19a63ee9f309a66a68d8c89dda9317b917df2103 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 711149c15c..7b328c0ccf 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 @@ -415,7 +415,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 @@ -456,12 +456,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.11.0