Update app/components/home/tab-content.tsx
All checks were successful
Deploy to Netlify / Deploy to Netlify (push) Successful in 1m32s

This commit is contained in:
Nathan 2025-09-29 12:05:11 +02:00
parent fa374e15a6
commit 3a15e60644

View file

@ -46,8 +46,12 @@ export default function TabContent({
); );
for (const day of days) { for (const day of days) {
// Group by examiner name/subject then sort by date // Group by examiner name/subject then sort by date
collesByDay[day]?.sort((a, b) => a.examiner.name?.localCompare(b.examiner.name)) collesByDay[day]?.sort((a, b) => {
.sort((a, b) => new Date(a?.date).getTime() - new Date(b?.date).getTime()) const nameA = a?.examiner?.name || "";
const nameB = b?.examiner?.name || "";
return nameA.localeCompare(nameB);
})
collesByDay[day]?.sort((a, b) => new Date(a?.date).getTime() - new Date(b?.date).getTime())
if (!isSorted) { if (!isSorted) {
collesByDay[day].reverse() collesByDay[day].reverse()
} }