From e209deefb1883e7fd698015117fbfad10aa52eef Mon Sep 17 00:00:00 2001 From: laxmi013 Date: Sun, 27 Oct 2024 19:50:34 +0530 Subject: [PATCH] updated --- frontend/src/appComponents/AdminResults.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/appComponents/AdminResults.tsx b/frontend/src/appComponents/AdminResults.tsx index 9df9415..5ec01be 100644 --- a/frontend/src/appComponents/AdminResults.tsx +++ b/frontend/src/appComponents/AdminResults.tsx @@ -110,8 +110,7 @@ export default function AdminResults() { sortedResults.sort((a, b) => b.score - a.score); break; case "Year": - sortedResults.sort((a, b) => a.user.year.localeCompare(b.user.year)); - break; + sortedResults.sort((a, b) => parseInt(a.user.year, 10) - parseInt(b.user.year, 10)); break; case "Rollno": sortedResults.sort((a, b) => parseInt(a.user.rollNo, 10) - parseInt(b.user.rollNo, 10)); break;