Summary: | Flatpickr's "yesterday" shortcut doesn't work if entry is limited to past dates | ||
---|---|---|---|
Product: | Koha | Reporter: | Owen Leonard <oleonard> |
Component: | Templates | Assignee: | Owen Leonard <oleonard> |
Status: | CLOSED FIXED | QA Contact: | Katrin Fischer <katrin.fischer> |
Severity: | minor | ||
Priority: | P5 - low | CC: | arthur.suzuki, jonathan.druart, lucas, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
22.11.00, 22.05.01, 21.11.07
|
|
Circulation function: | |||
Bug Depends on: | 29478 | ||
Bug Blocks: | |||
Attachments: |
Bug 30726: Fix "yesterday" when limited to past dates
Bug 30726: Fix "yesterday" when limited to past dates Bug 30726: Fix "yesterday" when limited to past dates |
Description
Owen Leonard
2022-05-10 14:57:44 UTC
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. |