You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we type a date and have max date selected as today, the component changes the value either to previously entered date or a previous valid year.
I want it to rather change the current value to null if future value is type and throw an error as well
When we type a date and have max date selected as today, the component changes the value either to previously entered date or a previous valid year.
I want it to rather change the current value to null if future value is type and throw an error as well
<DatePicker
onChange={(date) => {
setValue("dob", date ? ${date} : "");
setSelectDate(new Date(date ? ${date} : ""));
field.onChange(date);
}}
value={
selectDate
? new Date(selectDate)
: userDetailData?.date
? new Date(
userDetailData?.date
)
: undefined
}
format="MM/DD/YYYY"
placeholder="Select date of birth (MM/DD/YYYY)"
minDate={new Date("01/01/1920")}
maxDate={new Date()}
inputClass="relative w-full bg-[#DFDFDF] mt-2.5 h-14 pl-4 rounded-md font-Montserrat text-[15px] text-[#5E5E5E]"
className="custom-calendar"
arrowStyle={{ border: 0 }}
/>
The text was updated successfully, but these errors were encountered: