File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
library/src/components/timetable Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -458,7 +458,26 @@ export function getLeftAndWidth(
458458 }
459459
460460 const timeSpanMin = itemModEnd . diff ( itemModStart , "minute" )
461- const width = timeSpanMin / timeSlotMinutes
461+ const timeSpanDayDiff = itemModEnd . diff ( itemModStart , "day" )
462+ const overnightDiff =
463+ 24 * 60 * timeSpanDayDiff - timeSpanDayDiff * timeFrameDay . oneDayMinutes
464+ const timeSpanMinWithoutOvernight = timeSpanMin - overnightDiff
465+
466+ // remove night if it is not in the time frame
467+
468+ const width = timeSpanMinWithoutOvernight / timeSlotMinutes
469+
470+ console . log (
471+ "WIDTH TEST" ,
472+ width ,
473+ timeSpanMin / timeSlotMinutes ,
474+ overnightDiff ,
475+ dayStartDiff ,
476+ itemModStart . format ( ) ,
477+ itemModEnd . format ( ) ,
478+ item . startDate . format ( ) ,
479+ item . endDate . format ( ) ,
480+ )
462481
463482 if ( width <= 0 ) {
464483 // this should not happen, but if it does, we need to log it to find the error
You can’t perform that action at this time.
0 commit comments