shahabyazdi / react-multi-date-picker

a simple React datepicker component for working with gregorian, persian, arabic and indian calendars
https://shahabyazdi.github.io/react-multi-date-picker/
MIT License
766 stars 90 forks source link

DatePanel does not work when minDate is set with multiple enabled #257

Open EdithAllison opened 7 months ago

EdithAllison commented 7 months ago

When a minDate is set and multiple enabled, the panel does not update.

return (
        <DatePicker
            multiple
                       values={values}
            onChange={setValues}
            plugins={[
                <DatePanel />
             ]}
            minDate={tomorrow}
            sort
    />
    )
Bildschirmfoto 2023-11-28 um 11 57 47
EdithAllison commented 7 months ago

UPDATE: this isn't an error with the date panel but with mindate & multiples. If I select mindate as the first selected date, the calendar behaves weirdly, for example the onChange and mapDays functions are not called.

Workaround: to get mindate to work with multiple dates, I have removed mindate and instead use the mapDays function to disable all dates that are smaller than tomorrow.

Here's a screenshot showing that if I select the mindate as first date, the input field is not correctly updated; but if I select any other date it works fine:

mindate-bug

Mikalai-Kastsevich-ITechArt commented 2 weeks ago

I have the same issue but wit max date