From 39cc1b5a0b6afb3338d17e84fbfd41732b62775b Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Mon, 19 Jul 2021 16:02:45 +0300 Subject: [PATCH] Timezone/UX issue: Wrong day is selected when timezone differs by -1 day (#961). --- assets/js/frontend_book_api.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/assets/js/frontend_book_api.js b/assets/js/frontend_book_api.js index 7593c82c..f544011b 100755 --- a/assets/js/frontend_book_api.js +++ b/assets/js/frontend_book_api.js @@ -99,6 +99,10 @@ window.FrontendBookApi = window.FrontendBookApi || {}; var availableHourMoment = moment .tz(selectedDate + ' ' + availableHour + ':00', providerTimezone) .tz(selectedTimezone); + + if (availableHourMoment.format('YYYY-MM-DD') !== selectedDate) { + return; // Due to the selected timezone the available hour belongs to another date. + } $('#available-hours').append( $('