davidtran / react-google-flight-datepicker

React date picker inspired by Google Flight
MIT License
385 stars 47 forks source link

SingleDatePicker date switching bug #53

Open oleholei opened 2 years ago

oleholei commented 2 years ago

Steps for reproduce:

Screenshot 2022-03-14 at 14 53 20

image

image

Screenshot 2022-03-14 at 14 54 04

image

image

oleholei commented 2 years ago

The component code in the project:

<SingleDatePicker 
        singleCalendar 
        highlightToday
        dateFormat={calendarFormat} // "DD-MM-YYYY"
        startWeekDay="monday"
        startDate={date} // current date on mount
        maxDate={DateUtils.maxDate} // Date of today
        minDate={DateUtils.minDate} // Date of 5 years ago
        startDatePlaceholder={`${dayMonthPlaceholder}-${dayMonthPlaceholder}-${yearPlaceholder}`} // "__-__-___"
        onChange={onChange}
        disabled={disabled}
/>