question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

  1. Change date in any picker from the example
  2. 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:closed
  • Created 6 years ago
  • Comments:24 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
ankurk91commented, Aug 30, 2017

@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

1reaction
ankurk91commented, Sep 5, 2017

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found