fix: 🐛 Felaktig sortering av lektioner (#595)
* fix: 🐛 incorrect sorting of lessons in timetable ✅ Closes: #591 * fix: 🐛 end time when overlapping lessons * style: 💄 lint
This commit is contained in:
parent
69e21ac68f
commit
ed3a27bba1
|
@ -32,7 +32,7 @@ export const DaySummary = ({
|
|||
|
||||
const lessons = weekLessons
|
||||
.filter((lesson) => lesson.dayOfWeek === currentDate.isoWeekday())
|
||||
.sort((a, b) => a.dateStart.localeCompare(b.dateStart))
|
||||
.sort((a, b) => a.timeStart.localeCompare(b.timeStart))
|
||||
|
||||
if (lessons.length <= 0) {
|
||||
return null
|
||||
|
@ -62,7 +62,9 @@ export const DaySummary = ({
|
|||
{translate('schedule.end')}
|
||||
</Text>
|
||||
<Text category="h5">
|
||||
{lessons[lessons.length - 1].timeEnd.slice(0, 5)}
|
||||
{lessons
|
||||
.sort((a, b) => a.timeEnd.localeCompare(b.timeEnd))
|
||||
[lessons.length - 1].timeEnd.slice(0, 5)}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
|
|
@ -169,7 +169,7 @@ export const Week = ({ child }: WeekProps) => {
|
|||
lunch={menu[index] || {}}
|
||||
lessons={lessons
|
||||
.filter((lesson) => days[lesson.dayOfWeek - 1] === weekDay)
|
||||
.sort((a, b) => a.dateStart.localeCompare(b.dateStart))}
|
||||
.sort((a, b) => a.timeStart.localeCompare(b.timeStart))}
|
||||
/>
|
||||
))}
|
||||
</ViewPager>
|
||||
|
|
Loading…
Reference in New Issue