Skip to content

Commit

Permalink
Patch error with Safari while booking related to time parsing (#1584)
Browse files Browse the repository at this point in the history
  • Loading branch information
alextselegidis committed Aug 12, 2024
1 parent dcf9015 commit 14a0c38
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 5 additions & 8 deletions assets/js/pages/booking.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 14a0c38

Please sign in to comment.