From bbee5b5e4b590db5667632cd36a0b28cafaecbb6 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Sun, 26 May 2024 16:35:09 -0700 Subject: [PATCH 1/2] fix: date formatting logic in enrollmentHistory for Safari (#987) Co-authored-by: Aponia --- apps/antalmanac/src/lib/enrollmentHistory.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/antalmanac/src/lib/enrollmentHistory.ts b/apps/antalmanac/src/lib/enrollmentHistory.ts index dab3b5fc3..d45ec24fd 100644 --- a/apps/antalmanac/src/lib/enrollmentHistory.ts +++ b/apps/antalmanac/src/lib/enrollmentHistory.ts @@ -105,9 +105,10 @@ export class DepartmentEnrollmentHistory { for (const enrollmentHistory of res) { const enrollmentDays: EnrollmentHistoryDay[] = []; - for (const [i, date] of enrollmentHistory.dates.entries()) { - const d = new Date(date); - const formattedDate = `${d.getMonth() + 1}/${d.getDate()}/${d.getFullYear()}`; + for (const [i, dateString] of enrollmentHistory.dates.entries()) { + const [day = '', month = '', year = ''] = dateString.split('-'); + const date = new Date(Number(day), Number(month), Number(year)); + const formattedDate = `${date.getMonth()}/${date.getDate() - 1}/${date.getFullYear()}`; enrollmentDays.push({ date: formattedDate, From 74112a963d150086837a3923de4156a1ad0f1fdf Mon Sep 17 00:00:00 2001 From: Dalton Adcock Date: Sun, 26 May 2024 16:35:42 -0700 Subject: [PATCH 2/2] Fixed GPA not showing on Courses Added pane (#988) --- .../components/RightPane/SectionTable/SectionTableBody.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/apps/antalmanac/src/components/RightPane/SectionTable/SectionTableBody.tsx b/apps/antalmanac/src/components/RightPane/SectionTable/SectionTableBody.tsx index 12779a216..9f5928c14 100644 --- a/apps/antalmanac/src/components/RightPane/SectionTable/SectionTableBody.tsx +++ b/apps/antalmanac/src/components/RightPane/SectionTable/SectionTableBody.tsx @@ -214,12 +214,7 @@ async function getGpaData(deptCode: string, courseNumber: string, instructors: s // Get the GPA of the first instructor of this section where data exists for (const instructor of namedInstructors) { - const grades = await Grades.queryGrades( - deptCode, - courseNumber, - instructor, - useTabStore.getState().activeTab != 1 - ); + const grades = await Grades.queryGrades(deptCode, courseNumber, instructor, false); if (grades?.averageGPA) { return { gpa: grades.averageGPA.toFixed(2).toString(),