Dynamically changing minDate/maxDate (date range picker)
See original GitHub issue[x] Other, please describe Not sure if it’s a bug or I am using it wrong (sorry for that).
Tell about your platform
- flatPickr version : 3.0.0 (from unpkg)
- Vue.js version : 2.4.2 (from unpkg)
- Browser name and version : Chrome 55.0
Current behavior Changing minDate and maxDate in the config objects does not trigger component redraw.
Expected behavior Changing the dates in the fiddle below should update both pickers accordingly to allow proper date range selection (startDate < endDate).
Minimal reproduction of the problem with instructions JSFiddle
- Change date in any picker from the example
- The other should update it’s bounds accordingly (but it doesn’t, so I can select an invalid date range with endDate before startDate like
2017-08-29 ~ 2017-08-10
, for example)
P.S.: Thank you for creating this component. I was searching for a long time for a good-looking date picker, now the only thing left is getting it to work for me 😃
Issue Analytics
- State:
- Created 6 years ago
- Comments:24 (10 by maintainers)
Top Results From Across the Web
in daterangepicker how can i set minDate Dynamically?
bind an onChange event listener to the start_date input and inside the handler, fetch the start_date 's value and add one more day...
Read more >How to Change Date range Dynamically in jQuery UI ...
With minDate and maxDate options you can specify the date range. It restricts the users to pick a date within the specified range....
Read more >How to Set minimum and maximum date dynamically in ...
I have put two datepikcer from date and to date in my webpage for generate report. I want to apply validation on both...
Read more >Dynamically set the max min date at input field with React
In this article, I will show you a very simple example to demonstrate the situation that if you writing a admin to limit...
Read more >DateEntry Maxdate Mindate options to dynamically change ...
While presenting DateEntry box to the user in a Tkinter window we can set the value of Minimum date and maximum date which...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@RaZeR-RBI I suspect this is Vue.js reactivity issue. Your new configs are not being detected by component and date picker not updated.
Till we get a fix you may try range mode - https://chmln.github.io/flatpickr/examples/#range-calendar
@TheDiehard22 Great idea, i can $emit the
onChange
event and parent component can listen it. I will give it a try soon.P.S. See WIP on
dev
branch