minDate with a maxDate that is a date prior to current #2355
Unanswered
HeyWrecker
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I have a configuration where I'm using the single date picker to select a legal guardian date of birth. The maxDate needs to be a date calculated so that they are at minimum, 18 years old as of the current date. So, for example, the maxDate for today would be 05/30/2006. I set a minimum date of 01/01/1901. Therefore my
minDate
is "01/01/1901" and mymaxDate
is (as of today) "05/30/2006". When set, the calendar opens to May, 1901 with all of the dates stricken out. This is in the mode where the daterangepicker opens with the input initially empty. Here's my basic configuration:I'm also attaching a screenshot of the visual behavior.
If I set
maxDate
to the current date then this behavior does not occur. It defaults to the current day with no dates stricken out. Here is a screenshot with themaxDate
set to "05/30/2024".A similar effect occurs if I set the
maxDate
to "04/30/2024". However, in this case it opens on May 2024 (unexpected) with the dates stricken out (expected).Has anybody else ever run into an issue where you've tried to set a
maxDate
prior to the current date / in the past as opposed to using it to limit future date selection?Please note, that I am trying to avoid setting an actual
startDate
andendDate
because I do not want to default somebody's date of birth selection.Beta Was this translation helpful? Give feedback.
All reactions