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 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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user