From 084660a6df8750120f933b2fa8327276a9b7c59a Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 24 Jun 2026 15:11:56 +0000 Subject: [PATCH] Bug 42868: Use local timezone instead of UTC when calculating start and end dates To test: 1 - Edit koha-conf.xml 2 - Set timezone: America/New_York 3 - In Koha, enable bookings syspref 4 - Find a record, click the items tab, make an item bookable 5 - Place new booking, choose a date range 6 - View the bookings tab - note the booking extends into the date before 7- Check the DB, the start_date and end_date are wrong 8. APPLY PATCH, restart_all, clear browsewr cache 9. Place a new booking. 10. MariaDB [koha_kohadev]> select * from bookings WHERE booking_id={new booking} 11. Notice the start time should be {start_date} 00:00:00 and the end time should be {end_date} 23:59:59 Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Pedro Amorim --- koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js | 5 ++--- 1 file changed, 2 insertions(+), 3 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 a991215046..36a37e151e 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js +++ b/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js @@ -970,17 +970,16 @@ $("#placeBookingModal").on("show.bs.modal", function (e) { ); $("#booking_start_date").val( dayjs - .utc(startDate) + .tz(startDate, $timezone()) .startOf("day") .toISOString() ); $("#booking_end_date").val( dayjs - .utc(endDate) + .tz(endDate, $timezone()) .endOf("day") .toISOString() ); - // set available items in select2 let booked_items = bookings.filter( function (booking) {