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 = [];
|
const groups = [];
|
||||||
for (let i = 0; i < activeDays.length; i += 3) {
|
for (let i = 0; i < activeDays.length; i += 3) {
|
||||||
groups.push({
|
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,
|
startIndex: i,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
visibleDays: activeDays.slice(indexInActiveDays, indexInActiveDays + 3),
|
visibleDays: activeDays.slice(indexInActiveDays, indexInActiveDays + 3).reverse(),
|
||||||
tabGroups: groups,
|
tabGroups: groups,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ const Timetable = ({ from_date, to_date, day_start, day_end }: TimetableProps) =
|
|||||||
startIndex: idx,
|
startIndex: idx,
|
||||||
}));
|
}));
|
||||||
return {
|
return {
|
||||||
visibleDays: activeDays.slice(indexInActiveDays, indexInActiveDays + 1),
|
visibleDays: activeDays.slice(indexInActiveDays, indexInActiveDays + 1).reverse(),
|
||||||
tabGroups: groups,
|
tabGroups: groups,
|
||||||
};
|
};
|
||||||
}, [tier, days, reversedDays, selectedDayIndex]);
|
}, [tier, days, reversedDays, selectedDayIndex]);
|
||||||
|
|||||||
Reference in New Issue
Block a user