fixed page key

This commit is contained in:
2024-09-02 11:21:07 -06:00
parent 1b03061fdd
commit 130035cc48
15 changed files with 446 additions and 336 deletions

View File

@@ -4,20 +4,24 @@ import { useCourseContext } from "../context/courseContext";
import { getMonthsBetweenDates } from "./calendarMonthUtils";
import { CalendarMonth } from "./CalendarMonth";
import { useLocalCourseSettingsQuery } from "@/hooks/localCourse/localCoursesHooks";
import { useMemo } from "react";
export default function CourseCalendar() {
const { courseName } = useCourseContext();
const { data: settings } = useLocalCourseSettingsQuery(courseName);
const startDateTime = getDateFromStringOrThrow(
settings.startDate,
"course start date"
const startDateTime = useMemo(
() => getDateFromStringOrThrow(settings.startDate, "course start date"),
[settings.startDate]
);
const endDateTime = getDateFromStringOrThrow(
settings.endDate,
"course end date"
const endDateTime = useMemo(
() => getDateFromStringOrThrow(settings.endDate, "course end date"),
[settings.endDate]
);
const months = useMemo(
() => getMonthsBetweenDates(startDateTime, endDateTime),
[endDateTime, startDateTime]
);
const months = getMonthsBetweenDates(startDateTime, endDateTime);
return (
<div