fix calendar

This commit is contained in:
Thomas Ruoff
2022-02-20 00:14:54 +01:00
parent afe10b85f3
commit ddb2f40298

View File

@@ -13,7 +13,7 @@ import { dateFormatBackend } from '../helpers/date'
import { getNextBigger, getNextSmaller } from '../helpers/array'
import Loading from './loading'
export default function PlainCalendar({
export default function MyCalendar({
start,
end,
onChange = null,
@@ -96,7 +96,7 @@ export default function PlainCalendar({
<h2 className="text-xl">Belegungsplan</h2>
<Loading loading={daysBookedLoading}>
<Calendar
activeStartDate={startDate}
defaultActiveStartDate={startDate}
minDate={new Date()}
// @ts-ignore
onClickDay={(
@@ -120,7 +120,8 @@ export default function PlainCalendar({
return
}
if (!startDate || !!endDate) {
// when startDate missing or both are already set
if (!startDate || (!!startDate && !!endDate)) {
onChange({ startDate: dateFormatBackend(date), endDate: null })
return
}