From 026b65fbb77ef5d2c31ea45f709ea21e02d6e930 Mon Sep 17 00:00:00 2001 From: Paul Derscheid Date: Wed, 14 Aug 2024 09:24:49 +0000 Subject: [PATCH] Bug 37643: Check for NaN instead of truthiness if calendar.inc accepts_time To test: 1) Go to circulation.pl (checking out to a patron) 2) Click the settings in the barcode input 3) Set any due date with the time set to 00:00 4) Note that the picker resets the time to 23:59 5) Apply the patch 6) Repeat 1-3 7) Note that the time (00:00) stays put 8) Sign off Signed-off-by: Owen Leonard --- koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc index 8d60a21370..9f1cdb6ceb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -116,7 +116,7 @@ if ( !accepts_period ) { if ( accepts_time ) { let parsedDate = flatpickr.parseDate(dateText, instance.config.dateFormat); - if ( !parsedDate.getHours() ) { + if ( Number.isNaN(parsedDate.getHours()) ) { instance.setDate(selectedDates[0].setHours(23, 59, 0, 0)); } } -- 2.39.2