Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong working of disableDates function. #24

Open
godziniak opened this issue Jul 27, 2017 · 0 comments
Open

Wrong working of disableDates function. #24

godziniak opened this issue Jul 27, 2017 · 0 comments

Comments

@godziniak
Copy link

godziniak commented Jul 27, 2017

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 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant