From 7f02741807203563138728ab8d347aa41c902dbf Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 22 Apr 2025 20:30:59 +0000 Subject: [PATCH] Bug 39584: Use startDate instead of hoverDate when calculating loan period on mouseover To test: 1. Set up two days of post-processing time in the circ rules for an item type. 2. Make that item type bookable. 3. Place a booking for an item from that item type. Note that the 2-days of post-processing time are factored into the total number of days allowed for the booking. For a 7-day circ period, the booking cannot be set for 7 days; it is enforced to end at 5. 4. APPLY PATCH 5. Try the booking again, this time you should be able to select the full loan period for that item. --- koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js b/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js index 84330c3960b..7c6f4a0ffc7 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js +++ b/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js @@ -931,8 +931,10 @@ $("#placeBookingModal").on("show.bs.modal", function (e) { ? startDate.subtract(leadDays, "day") : hoverDate.subtract(leadDays, "day"); const leadEnd = startDate ? startDate : hoverDate; - const trailStart = hoverDate; - const trailEnd = hoverDate.add(trailDays, "day"); + const trailStart = startDate; + const trailEnd = startDate + ? startDate.add(trailDays, "day") + : null; let leadDisable = false; let trailDisable = false; -- 2.39.5