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

setDatesDisabled not working #2661

Open
RainenterMudin opened this issue Aug 4, 2022 · 4 comments
Open

setDatesDisabled not working #2661

RainenterMudin opened this issue Aug 4, 2022 · 4 comments

Comments

@RainenterMudin
Copy link

Expected behaviour

Tell us what should happen.
dates on array disabled

Actual behaviour

Tell us what happens instead.
datss on array not disabled

Datepicker version used

ex. 1.6.1.

This is the datepicker init
$('#date').datepicker({
// format: "yyyy/dd/mm",
format: "yyyy-mm-dd",
startDate: "1d",
endDate: "+30d",
// todayBtn: "linked",
language: "id",
orientation: "top right",
keyboardNavigation: false,
autoclose: true,
// daysOfWeekDisabled: disabledWeekDays,
beforeShowDay: function(date) {
var allDates = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
if (dissableddateee2.indexOf(allDates) != -1)
return false;
else
return true;

                    }
                });

this is
$('#date').datepicker('setDatesDisabled', ['2022-08-15']); --> array just example

Example code

Jsfiddle example to reproduce the problem.

@KevinChauvet
Copy link

Same, I'm trying to find some information about it, but for now it's just not working.
It's working on the older version of datepicker, but if you use datepicker3 it's not.

@ptkato
Copy link

ptkato commented Dec 13, 2023

I think it has to do with the startDate and endDate options, when I drop those, datesDisabled works.

@KevinChauvet
Copy link

Indeed, if I remove them it works as well for me. But on the documentation, it's written that they are still actual

@ptkato
Copy link

ptkato commented Dec 13, 2023

Actually, let me rectify that, it seems to work while startDate/endDate are set, however it is dependent on the format option, if I feed it something like 2023-12-13, the format must be yyyy-mm-dd, otherwise datesDisabled won't work.

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

3 participants