Fix table selector order
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user