https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42790

--- Comment #13 from Paul Derscheid <[email protected]> ---
Created attachment 202503
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202503&action=edit
Bug 42790: (QA follow-up) Anchor the extend picker to the library timezone and
floor it after the due date

The extend picker did all of its date maths in the browser's local
timezone while the API talks in instants and staff-facing displays are
rendered in the library's configured timezone ($timezone()). With the
two zones apart, the day boundaries drift: the floor, the blocked
booking ranges and the submitted end-of-day all land on the wrong
calendar day (e.g. a due date of 07/30 23:59 library time producing a
floor of 08/01 in a +02:00 browser).

The picker also floored at today, so with a due date a week out every
selectable day but the last few shortened the loan instead of
extending it - while still consuming a renewal. And the native
required attribute fought the picker: submitting with an empty field
popped the browser's own validation bubble over the calendar instead
of the modal's styled error.

- do all calendar maths in the library's timezone and hand flatpickr
  display dates via $toDisplayDate, mirroring the place booking modal
  (bug 42868)
- anchor the submitted end date to the end of the selected day in the
  library's timezone
- floor the picker at the day after the checkout due date (today for
  overdue checkouts) so only genuine extensions are selectable
- mark the form novalidate; the submit handler's styled error message
  already covers the empty field

Test plan:
1. Book an item, check it out and open Extend on the issued row: the
   first selectable date is the day after the checkout due date, also
   when the browser and the Koha instance are in different timezones
2. Backdate the checkout due date into the past (or let it lapse) and
   confirm the picker floors at today instead
3. Extend and confirm checkout due date and booking end date land on
   23:59 of the selected day in the instance timezone
4. Submit with an empty date: the styled 'Please select a new end
   date' message appears in the modal, no browser bubble

Signed-off-by: Paul Derscheid <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to