fixing date formatting to month day year

This commit is contained in:
2024-08-27 19:59:26 -06:00
parent 4e412fd6bf
commit 27349af5b9
21 changed files with 284 additions and 212 deletions

View File

@@ -0,0 +1,32 @@
"use client";
import { getDateFromStringOrThrow } from "@/models/local/timeUtils";
import { useCourseContext } from "../context/courseContext";
import { getMonthsBetweenDates } from "./calendarMonthUtils";
import { CalendarMonth } from "./CalendarMonth";
export default function CourseCalendar() {
const context = useCourseContext();
const startDate = getDateFromStringOrThrow(
context.localCourse.settings.startDate,
"course start date"
);
const endDate = getDateFromStringOrThrow(
context.localCourse.settings.endDate,
"course end date"
);
const months = getMonthsBetweenDates(startDate, endDate);
return (
<>
{months.map((month) => (
<CalendarMonth
key={month.month + "" + month.year}
month={month}
localCourse={context.localCourse}
/>
))}
</>
);
}