address breaking changes

This commit is contained in:
Thomas Ruoff
2022-03-14 22:35:30 +01:00
committed by Thomas Ruoff
parent 8222e04880
commit ef7f80fd92
10 changed files with 41 additions and 46 deletions

View File

@@ -122,15 +122,15 @@ export default function MyCalendar({
// when startDate missing or both are already set
if (!startDate || (!!startDate && !!endDate)) {
onChange({ startDate: dateFormatBackend(date), endDate: null })
onChange({ startDate: date, endDate: null })
return
}
// when startDate set, but end missing
if (isAfter(date, startDate)) {
onChange({ endDate: dateFormatBackend(date) })
onChange({ endDate: date })
} else {
onChange({ startDate: dateFormatBackend(date), endDate: start })
onChange({ startDate: date, endDate: date })
}
}}
tileClassName={tileClassName}