month buffer

This commit is contained in:
2025-10-28 13:18:11 -06:00
parent 11c2366f93
commit 7fec0424d7
2 changed files with 13 additions and 4 deletions

View File

@@ -21,3 +21,11 @@ courses:
name: 1405 old
- path: ./1405/2026_spring_alex
name: "1405"
- path: ./1810/2026-spring-alex/modules
name: Web Intro Spring
- path: ./3840_Telemetry/2026_spring_alex
name: Telem and Ops New
- path: ./4620_Distributed/2025Spring/modules/
name: distributed-old
- path: ./4620_Distributed/2026-spring-alex/modules
name: Distributed

View File

@@ -13,10 +13,11 @@ export default function CourseCalendar() {
() => getDateFromStringOrThrow(settings.startDate, "course start date"),
[settings.startDate]
);
const endDateTime = useMemo(
() => getDateFromStringOrThrow(settings.endDate, "course end date"),
[settings.endDate]
);
const endDateTime = useMemo(() => {
const date = getDateFromStringOrThrow(settings.endDate, "course end date");
date.setDate(date.getDate() + 14); // buffer to make sure calendar shows week of finals and grades due
return date;
}, [settings.endDate]);
const months = useMemo(
() => getMonthsBetweenDates(startDateTime, endDateTime),
[endDateTime, startDateTime]