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

minDate can be maxDate (and vice versa) #150

Open
szotsaki opened this issue Jun 11, 2023 · 0 comments
Open

minDate can be maxDate (and vice versa) #150

szotsaki opened this issue Jun 11, 2023 · 0 comments

Comments

@szotsaki
Copy link

According to the documentation, minDate and maxDate denote the

Minimum/Maximum limit to selectable date.

According to the docs, the expected behaviour is if minDate is specified greater than maxDate, all dates are disabled.

Common code:

const today = new Date();
const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1); // Reproducer works with +2, +3, etc.

Correct behaviour:

new Datepicker(datepicker, {
    minDate: today,
    maxDate: tomorrow
});

Incorrect behaviour:

new Datepicker(datepicker, {
    minDate: tomorrow,
    maxDate: today
});

Result in both cases:
image

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