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 <oleonard@myacpl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e96a334aa8)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Paul Derscheid 2024-08-14 09:24:49 +00:00 committed by Lucas Gass
parent b55df97aa8
commit bce87fac43
1 changed files with 1 additions and 1 deletions

View File

@ -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));
}
}