mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-24 17:03:27 +03:00
Import the window moment object
This commit is contained in:
parent
230f052b9a
commit
82b25b50ad
1 changed files with 5 additions and 1 deletions
|
@ -22,6 +22,9 @@ App.Http.Booking = (function () {
|
|||
const $availableHours = $('#available-hours');
|
||||
const $captchaHint = $('#captcha-hint');
|
||||
const $captchaTitle = $('.captcha-title');
|
||||
|
||||
const moment = window.moment;
|
||||
|
||||
let unavailableDatesBackup;
|
||||
let selectedDateStringBackup;
|
||||
let processingUnavailableDates = false;
|
||||
|
@ -280,8 +283,9 @@ App.Http.Booking = (function () {
|
|||
if (setDate && !vars('manage_mode')) {
|
||||
for (let i = 1; i <= numberOfDays; i++) {
|
||||
const currentDate = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), i);
|
||||
|
||||
if (unavailableDates.indexOf(moment(currentDate).format('YYYY-MM-DD')) === -1) {
|
||||
$('#select-date')[0]._flatpickr.setDate( currentDate);
|
||||
$('#select-date')[0]._flatpickr.setDate(currentDate);
|
||||
getAvailableHours(moment(currentDate).format('YYYY-MM-DD'));
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue