Ability to set minimum length of range selection
See original GitHub issueI can’t figure out a way to enforce a minimum length for a range
flatpickr.
E.g. when selecting dates for a hotel booking, I don’t want the user to be able to chose the same date for both check-in and check-out. The check-out date must be at least 1 day later than check-in.
I tried using set()
to change minDate
inside an onChange()
callback when the user chooses the first date, but this resulted in an infinite loop (i’m using vue-bulma-datepicker).
Your Environment
- flatpickr version used: 2.4.2
- Browser name and version: Chrome 57
- OS and version: OSX 10.12.3
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Apply data validation to cells - Microsoft Support
In the Data box, select the type of restriction that you want. For example, to set upper and lower limits, select between. Enter...
Read more >Set capacity limits on your Auto Scaling group - Amazon EC2 ...
Capacity limits represent the minimum and maximum group size that you want for your Auto Scaling group. You set limits separately for the...
Read more >Part 15 - Contracting by Negotiation | Acquisition.GOV
At the conclusion of discussions, each offeror still in the competitive range shall be given an opportunity to submit a final proposal revision....
Read more >Computerized Adaptive Testing (CAT) - NCSBN
The minimum number of items for both the RN and PN exam is 75 rather than 75 and 85, respectively. The maximum number...
Read more >How to use MIN function in Excel - Ablebits
The MIN function checks your data range and returns the smallest value in the set. Its syntax is the following: MIN(number1, [number2], …)....
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 Free
Top 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
I solved it using following code:
replace <YOUR_RANGE_MIN_LENGTH> with the desired range length
hi @adambiggs, I’m trying to implement the same solution as you, did you manage to solve the problem with the set minDate on the range plugin ?