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 set via instance.set(), calendar open on second time all dates are disabled #3002

Open
0jscsshtml opened this issue Mar 26, 2024 · 0 comments

Comments

@0jscsshtml
Copy link

https://jsfiddle.net/tj2Lo4z7/

Your Environment

  • flatpickr version used: 4.6.13
  • Browser name and version: Brave 1.64.109
  • OS and version: window 11 Pro 23H2

While working on my plugin, the theme initialize flatpickr with data attribute like below:

data-fp-options="{"enableTime":true, "minTime":"10:00","maxTime":"17:00","altInput":true,"altFormat":"F j, Y H:i","dateFormat":"F j, Y H:i","time_24hr":false,"allowInput":true,"locale":{"firstDayOfWeek":1},"defaultHour":"10"}"

Use theme provided hook to add "minDate":"today" to the attribute, everything is working fine, but not "minDate":"April 15, 2024 10:00".

Try to use instance method like below:
const fp = datePickerField.querySelector('input.flatpickr')._flatpickr;
fp.set('minDate', new Date("April 15, 2024 10:00"));

flatpickr calendar working on first time modal open.

1

if no date selected and modal close, on next following modal open like below

2

But once click next arrow, everything is back to normal. am i missing something ?

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