From a1cd2f859e689d478a75189b8fb4258f24d9a5c3 Mon Sep 17 00:00:00 2001 From: Brendan Lawlor Date: Wed, 21 Aug 2024 15:52:24 +0000 Subject: [PATCH] Bug 37542: Fix patron search when dateofbirth is a DefaultPatronSearchField This patch updates the call to dayjs to use strict parsing for patron search. See https://day.js.org/docs/en/parse/string-format To test: 1. Create a patron with dateofbirth 1994-07-27 2. Add dateofbirth to DefaultPatronSearchFields 3. In patron or checkout search, type a cardnumber like '2908800092528' 4. Note the patron with that birth date is found in autocomplete 5. Apply patch and restart_all 6. Repeat step 3 and notice the patron is no longer found 7. In patron or checkout search, try searches using a formatted date 8. Confirm searches for '07/27/1994' and '1994-07-27' find the patron Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer (cherry picked from commit 764162cd6dc7c74a7028128d3d94ebc0eb5e90b0) Signed-off-by: Lucas Gass --- koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc index b9ef294f96..bce0620c48 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc @@ -91,7 +91,7 @@ window.$date_to_rfc3339 = function(value, options) { var dateformat = (options&&options.dateformat)||def_date_format; - let m = dayjs(value, get_date_pattern(dateformat)); + let m = dayjs(value, get_date_pattern(dateformat), true); return m.format("YYYY-MM-DD"); } -- 2.39.5