JavaScript RangeError on appointment change causing disabled calendar dates (#1092).

This commit is contained in:
Alex Tselegidis 2021-07-19 15:52:05 +03:00
parent 25b44063b4
commit cc6575d2d0

View file

@ -274,7 +274,7 @@ window.FrontendBookApi = window.FrontendBookApi || {};
// Select first enabled date. // Select first enabled date.
var selectedDate = Date.parse(selectedDateString); var selectedDate = Date.parse(selectedDateString);
var numberOfDays = new Date(selectedDate.getFullYear(), selectedDate.getMonth() + 1, 0).getDate(); var numberOfDays = moment(selectedDate).daysInMonth();
if (setDate && !GlobalVariables.manageMode) { if (setDate && !GlobalVariables.manageMode) {
for (var i = 1; i <= numberOfDays; i++) { for (var i = 1; i <= numberOfDays; i++) {