Register the non-timezoned time in the database.
This commit is contained in:
parent
3371a8e0a2
commit
69a0c2a48f
2 changed files with 6 additions and 3 deletions
|
@ -632,7 +632,7 @@ window.FrontendBook = window.FrontendBook || {};
|
|||
|
||||
data.appointment = {
|
||||
start_datetime: $('#select-date').datepicker('getDate').toString('yyyy-MM-dd')
|
||||
+ ' ' + Date.parse($('.selected-hour').text()).toString('HH:mm') + ':00',
|
||||
+ ' ' + Date.parse($('.selected-hour').data('value') || '').toString('HH:mm') + ':00',
|
||||
end_datetime: calculateEndDatetime(),
|
||||
notes: $('#notes').val(),
|
||||
is_unavailable: false,
|
||||
|
@ -666,7 +666,7 @@ window.FrontendBook = window.FrontendBook || {};
|
|||
|
||||
// Add the duration to the start datetime.
|
||||
var startDatetime = $('#select-date').datepicker('getDate').toString('dd-MM-yyyy')
|
||||
+ ' ' + Date.parse($('.selected-hour').text()).toString('HH:mm');
|
||||
+ ' ' + Date.parse($('.selected-hour').data('value') || '').toString('HH:mm');
|
||||
startDatetime = Date.parseExact(startDatetime, 'dd-MM-yyyy HH:mm');
|
||||
var endDatetime;
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ window.FrontendBookApi = window.FrontendBookApi || {};
|
|||
var selectedTimezone = $('#select-timezone').val();
|
||||
var timeFormat = GlobalVariables.timeFormat === 'regular' ? 'h:mm a' : 'HH:mm';
|
||||
|
||||
response.forEach(function (availableHour, index) {
|
||||
response.forEach(function (availableHour) {
|
||||
var availableHourMoment = moment
|
||||
.tz(selectedDate + ' ' + availableHour + ':00', providerTimezone)
|
||||
.tz(selectedTimezone);
|
||||
|
@ -98,6 +98,9 @@ window.FrontendBookApi = window.FrontendBookApi || {};
|
|||
$('#available-hours').append(
|
||||
$('<button/>', {
|
||||
'class': 'btn btn-outline-secondary btn-block shadow-none available-hour',
|
||||
'data': {
|
||||
'value': availableHour
|
||||
},
|
||||
'text': availableHourMoment.format(timeFormat)
|
||||
})
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue