@@ -3,7 +3,7 @@ import interactionPlugin from "@fullcalendar/interaction";
3
3
import timeGridPlugin from "@fullcalendar/timegrid" ;
4
4
import { DateSelectArg , EventChangeArg , EventInput } from "@fullcalendar/core" ;
5
5
import { Button , Modal , useDisclosure , useMantineTheme } from "@quassel/ui" ;
6
- import { GapsPerDay , getDateFromTimeAndWeekday , getTime , groupByWeekday , isSame } from "@quassel/utils" ;
6
+ import { GapsPerDay , getDateFromTimeAndWeekday , getNext , getTime , groupByWeekday , isSame } from "@quassel/utils" ;
7
7
import { QuestionnaireEntry } from "./QuestionnaireEntry" ;
8
8
import { components } from "../../../api.gen" ;
9
9
import { EntityForm , EntryFormValues } from "./EntryForm" ;
@@ -154,10 +154,13 @@ export function EntryCalendar({
154
154
open ( ) ;
155
155
} ;
156
156
157
- const handleEventChange = ( { event } : EventChangeArg ) => {
158
- const { id, start, end } = event ;
157
+ const handleEventChange = ( { event : { id, start, end } } : EventChangeArg ) => {
159
158
if ( ! start || ! end ) return ;
160
159
160
+ if ( end . getMinutes ( ) === 59 && end . getHours ( ) < 23 ) {
161
+ end = getNext ( "hour" , end ) ;
162
+ }
163
+
161
164
const startTime = getTime ( start ) < C . calendar . minTime ? C . calendar . minTime : getTime ( start ) ;
162
165
const endTime = isSame ( "day" , start , end ) ? getTime ( end ) : C . calendar . maxTime ;
163
166
0 commit comments