From 5044b7b58dbf2adfbe32d197fb1714751a879e75 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Thu, 6 Mar 2025 00:37:40 +0100 Subject: [PATCH] Fix day header inserted into break If a span ended on midnight the next day header would be started on the break and the sameDay check would match the day of the next span causing the day header to be inserted into the break column. Fix by checking that the last day header has a non-zero span in the same day check. --- components/Timetable.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/Timetable.vue b/components/Timetable.vue index 5143339..5a7526b 100644 --- a/components/Timetable.vue +++ b/components/Timetable.vue @@ -330,7 +330,8 @@ function tableElementsFromStretches( } else { startColumnGroup("break"); const dayName = stretch.start.slice(0, 10) - const sameDay = dayName === dayHeaders[dayHeaders.length - 1].content; + const lastDayHeader = dayHeaders[dayHeaders.length - 1] + const sameDay = dayName === lastDayHeader.content && lastDayHeader.span; if (!sameDay) startDay(); startHour("break");