react-multi-date-picker icon indicating copy to clipboard operation
react-multi-date-picker copied to clipboard

Random past date when max date is today and we type a future date.

Open atharvaBelgeW opened this issue 1 year ago • 0 comments

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 }} />

atharvaBelgeW avatar Feb 07 '24 05:02 atharvaBelgeW