Skip to content

Wrong working of disableDates function. #24

@godziniak

Description

@godziniak

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 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions