DatePicker maxDate and minDate
See original GitHub issueIt would be awesome to be able to set the maxDate
and minDates
that are considered selectable in the datePicker and timePicker. For example, using the range picker, I want to the user to only be able to select past dates/times. With something like jqueryui’s date picker you can set it with the (max/min)Date
apis.
Currently this is sort of possible with validation but its not a great user experience.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:10
- Comments:13 (1 by maintainers)
Top Results From Across the Web
Changing minDate and maxDate on the fly using jQuery ...
I have changed min date property of date time picker by using this $('#date').data("DateTimePicker").minDate(startDate);.
Read more >How to Set minimum and maximum date in jQuery UI Datepicker
With minDate and maxDate options, you can restrict date range of jQuery UI Datepicker widget. The user will only able to select the...
Read more >Datepicker Widget - jQuery UI API Documentation
The jQuery UI Datepicker is a highly configurable plugin that adds datepicker functionality to your pages. You can customize the date format and...
Read more >jquery datepicker maxdate or maxDate and mindate or minDate
Date: A date object containing the maximum date. • Number: A number of days from today. For example 2 represents two days from...
Read more >How to enable and disable or set maxDate and minDate in the ...
In this article, we have described with an example code, how to enable and disable or set maxDate and minDate in the datepicker....
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
I was able to accomplish this by
<DatePicker disabledDate={d => !d || d.isAfter("2002-12-31") || d.isSameOrBefore("1960-01-01") } format="YYYY-MM-DD HH:mm:ss" defaultPickerValue={moment("2002-12-31")} placeholder="Start" />
@benjycui I would like to have minDate and maxDate too. disabledDate rule works only for days in month, not for months and years, so user can change months and years even though all dates in month/year are disabled. Or you can approve disabledDate behaviour for month/year pickers