mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
fix calendar
This commit is contained in:
committed by
Thomas Ruoff
parent
0d71a41c9a
commit
0aaca45c47
@@ -13,7 +13,7 @@ import { dateFormatBackend } from '../helpers/date'
|
|||||||
import { getNextBigger, getNextSmaller } from '../helpers/array'
|
import { getNextBigger, getNextSmaller } from '../helpers/array'
|
||||||
import Loading from './loading'
|
import Loading from './loading'
|
||||||
|
|
||||||
export default function PlainCalendar({
|
export default function MyCalendar({
|
||||||
start,
|
start,
|
||||||
end,
|
end,
|
||||||
onChange = null,
|
onChange = null,
|
||||||
@@ -96,7 +96,7 @@ export default function PlainCalendar({
|
|||||||
<h2 className="text-xl">Belegungsplan</h2>
|
<h2 className="text-xl">Belegungsplan</h2>
|
||||||
<Loading loading={daysBookedLoading}>
|
<Loading loading={daysBookedLoading}>
|
||||||
<Calendar
|
<Calendar
|
||||||
activeStartDate={startDate}
|
defaultActiveStartDate={startDate}
|
||||||
minDate={new Date()}
|
minDate={new Date()}
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
onClickDay={(
|
onClickDay={(
|
||||||
@@ -120,7 +120,8 @@ export default function PlainCalendar({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!startDate || !!endDate) {
|
// when startDate missing or both are already set
|
||||||
|
if (!startDate || (!!startDate && !!endDate)) {
|
||||||
onChange({ startDate: dateFormatBackend(date), endDate: null })
|
onChange({ startDate: dateFormatBackend(date), endDate: null })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user