Bug 30726: Fix "yesterday" when limited to past dates

Test plan:
Go to "Patrons with no checkouts" report, /cgi-bin/koha/reports/borrowers_out.pl
Select "Yesterday"
=> it automatically selects the previous day's date and populates the form field

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2022-06-01 14:36:52 +02:00 committed by Tomas Cohen Arazi
parent c699f05970
commit 637c580663
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -148,7 +148,7 @@
disable_buttons.push(2); /* Tomorrow */
}
if( $(this).data("flatpickr-pastdate") === true ) {
options['maxDate'] = new Date().fp_incr(-1);
options['maxDate'] = new Date().fp_incr(-1).setHours(23, 59, 00, 00);
disable_buttons.push(1); /* Today */
disable_buttons.push(2); /* Tomorrow */
}