-
Notifications
You must be signed in to change notification settings - Fork 42
Description
Hi, just spent some time to find why my dates from database are different than disabled in frontend calendar... There is a mistake in disableDates - check in your demos and examples. It return right numbers, but disabling wrong field on calendar.
Ok i managed whats wrong... Im from Poland and have +2 to timezone - it works well when I use a Unix time for example:
datepicker.disabledDates = [new Date(1498860000000),];
and that way works well.
BTW i changed some your original code that is responsible for displaying disabledDates so now i have pretty ready date to my sql database (near line 720):
"selectedDates": { get: function () { var xdates, i; xdates = new Array(); selectedDates.sort(function(a,b){return a.getTime() - b.getTime();}); for (i = 0; i < selectedDates.length; i++) { xdates.push(moment(selectedDates[i]).format('YYYY-MM-DD')); } return xdates; } },
and in console i have:
(2) ["2017-08-20", "2017-08-27"]
when use a console.log(datepicker.selectedDates)
Im not a programmer, more a webdesigner so maybe its clear and easy for programmers :)
Good job anyway 👍