From c93c0b0e22fb3c81c35afb0d3ccae56a0cf67488 Mon Sep 17 00:00:00 2001 From: Alex Mickelson Date: Tue, 15 Jul 2025 14:00:32 -0600 Subject: [PATCH] default expand past courses --- src/app/course/[courseName]/calendar/CalendarMonth.tsx | 6 ++++-- .../lecture/[lectureDay]/preview/LecturePreviewPage.tsx | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/course/[courseName]/calendar/CalendarMonth.tsx b/src/app/course/[courseName]/calendar/CalendarMonth.tsx index 866ac01..3c19f6e 100644 --- a/src/app/course/[courseName]/calendar/CalendarMonth.tsx +++ b/src/app/course/[courseName]/calendar/CalendarMonth.tsx @@ -17,6 +17,8 @@ export const CalendarMonth = ({ month }: { month: CalendarMonthModel }) => { "week calculation start date" ); + const isPastSemester = Date.now() > new Date(settings.endDate).getTime(); + const pastWeekNumber = getWeekNumber( startDate, new Date(Date.now() - four_days_in_milliseconds) @@ -27,7 +29,7 @@ export const CalendarMonth = ({ month }: { month: CalendarMonthModel }) => { new Date(month.year, month.month, 1) ); - const isInPast = pastWeekNumber >= startOfMonthWeekNumber; + const shouldCollapse = (pastWeekNumber >= startOfMonthWeekNumber) && !isPastSemester; const monthName = new Date(month.year, month.month - 1, 1).toLocaleString( "default", @@ -37,7 +39,7 @@ export const CalendarMonth = ({ month }: { month: CalendarMonthModel }) => { return ( <> (

- Edit Page + Edit Lecture