If you configure a Flatpickr instance with the "pastdate" option (See the "Patrons with no checkouts" report, /cgi-bin/koha/reports/borrowers_out.pl), the "Yesterday" shortcut doesn't work. It should automatically select the previous day's date and populate the form field.
I think this is the correct fix: diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc index 1e17eccd573..5b433881377 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -152,7 +152,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 */ }
Created attachment 135540 [details] [review] 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
Created attachment 135552 [details] [review] 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>
Created attachment 135723 [details] [review] 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>
Pushed to master for 22.11. Nice work everyone, thanks!
Pushed to 22.05.x for 22.05.01
thx! pushed to 21.11.x for 21.11.07
Missing dependencies for 21.05.x, it shouldn't be affected, no backport. Nothing to document, marking resolved.