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

last day of maxDate can not be selected at 4.4.1 version!

Open Amirhossein-Ghasemzadeh opened this issue 1 year ago • 4 comments

you can check it here: https://codesandbox.io/s/react-multi-date-picker-forked-8szhdq

Amirhossein-Ghasemzadeh avatar Nov 20 '23 17:11 Amirhossein-Ghasemzadeh

same issue here, and if passed the last minute of maxDate which is 23:59, it will be selectable but it sets the value immediately on opening the calendar.

olfatgh avatar Mar 15 '24 09:03 olfatgh

Same here on 4.5.1. Minimal setup https://codesandbox.io/p/sandbox/recat-multi-62xs7c When you select the last date and then some other dates they'll all disappear after closing the calendar.

handzlikt avatar May 27 '24 10:05 handzlikt

Any solution here?

info2programmer avatar Jul 02 '24 11:07 info2programmer

@info2programmer after looking into the implementation of this library I've figured out there is an issue with initializing the DateObject. It uses current time which later fails when comparing dates. As as a workaround I'm passing DateObject initialized with a time (beginning of a day or end of a day):

minDate={
        new DateObject({
          date: '06/02/2024 00:00:01',
          format: 'MM/DD/YYYY HH:mm:ss,
        })
}
maxDate={
        new DateObject({
          date: '07/02/2024 23:59:59',
          format: 'MM/DD/YYYY HH:mm:ss',
        })
}

handzlikt avatar Jul 02 '24 11:07 handzlikt