From 14a0c38ac0104359957bf949ab9878c6fe2bffbe Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Mon, 12 Aug 2024 08:52:37 +0200 Subject: [PATCH] Patch error with Safari while booking related to time parsing (#1584) --- CHANGELOG.md | 7 +++++++ assets/js/pages/booking.js | 13 +++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5069948c..299e51e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ This file contains the code changes that were introduced into each release (starting from v1.1.0) so that is easy for developers to maintain and readjust their custom modifications on the main project codebase. +## [Unreleased] + +### Fixed + +- Fix the date parsing issue on Safari web browsers during the booking process (#1584) + + ## [1.5.0] - 2024-07-07 ### Added diff --git a/assets/js/pages/booking.js b/assets/js/pages/booking.js index ef5d6260..02c182cd 100644 --- a/assets/js/pages/booking.js +++ b/assets/js/pages/booking.js @@ -675,17 +675,14 @@ App.Pages.Booking = (function () { const selectedDateMoment = moment(selectedDateObject); const selectedDate = selectedDateMoment.format('YYYY-MM-DD'); const selectedTime = $availableHours.find('.selected-hour').text(); - const selectedDateTime = `${selectedDate} ${selectedTime}`; - let formattedSelectedDate; + let formattedSelectedDate = ''; if (selectedDateObject) { - formattedSelectedDate = App.Utils.Date.format( - selectedDateTime, - vars('date_format'), - vars('time_format'), - true, - ); + formattedSelectedDate = + App.Utils.Date.format(selectedDate, vars('date_format'), vars('time_format'), false) + + ' ' + + selectedTime; } const timezoneOptionText = $selectTimezone.find('option:selected').text();