From be6a8dfd368bcb3deeec87db71649538768e4bfc Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 26 Apr 2023 15:28:49 +0000 Subject: [PATCH] Bug 33616: Make sure match() is evaluated against a string To Test: 1. Set ClaimReturnedLostValue to a LOST value 2. Check out an item to a patron. 3. Click the Claim returned button within the checkout table. 4. Get spinning icon in place of the button 5. In the web developer tools console: Uncaught TypeError: value.match is not a function 6. Apply patch 7. Try 2 - 3 again. This time the spinning icon should turn into a grey button with the correct date. 8. There should no longer be a console error. Signed-off-by: David Nind --- 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 7a54fa773a..0ad4b422e9 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 @@ -43,7 +43,7 @@ if(!value) return ''; var tz = (options&&options.tz)||def_tz; var m = dayjs(value); - if ( ! value.match(/^\d{4}-\d{2}-\d{2}$/ ) ) { + if ( ! value.toString().match(/^\d{4}-\d{2}-\d{2}$/ ) ) { m = m.tz(tz); } -- 2.30.2