From 9acb0ffed426e73f9c44c123ff49a28591ad85e5 Mon Sep 17 00:00:00 2001 From: Jacob Hagstedt Date: Fri, 29 May 2026 10:17:55 +0200 Subject: [PATCH] Fix table selector order --- frontend/src/components/stats/SleepTimetable.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/stats/SleepTimetable.tsx b/frontend/src/components/stats/SleepTimetable.tsx index 3944609..064dfd5 100644 --- a/frontend/src/components/stats/SleepTimetable.tsx +++ b/frontend/src/components/stats/SleepTimetable.tsx @@ -80,12 +80,12 @@ const Timetable = ({ from_date, to_date, day_start, day_end }: TimetableProps) = const groups = []; for (let i = 0; i < activeDays.length; i += 3) { groups.push({ - label: `${formatDayLabel(activeDays[i])} - ${formatDayLabel(activeDays[Math.min(i + 2, activeDays.length - 1)])}`, + label: `${formatDayLabel(activeDays[Math.min(i + 2, activeDays.length - 1)])} - ${formatDayLabel(activeDays[i])}`, startIndex: i, }); } return { - visibleDays: activeDays.slice(indexInActiveDays, indexInActiveDays + 3), + visibleDays: activeDays.slice(indexInActiveDays, indexInActiveDays + 3).reverse(), tabGroups: groups, }; } @@ -96,7 +96,7 @@ const Timetable = ({ from_date, to_date, day_start, day_end }: TimetableProps) = startIndex: idx, })); return { - visibleDays: activeDays.slice(indexInActiveDays, indexInActiveDays + 1), + visibleDays: activeDays.slice(indexInActiveDays, indexInActiveDays + 1).reverse(), tabGroups: groups, }; }, [tier, days, reversedDays, selectedDayIndex]);