"use client"; import { CalendarMonthModel } from "./calendarMonthUtils"; import { DayOfWeek } from "@/models/local/localCourseSettings"; import { Expandable } from "@/components/Expandable"; import { CalendarWeek } from "./CalendarWeek"; export const CalendarMonth = ({ month }: { month: CalendarMonthModel }) => { // const weekInMilliseconds = 604_800_000; const four_days_in_milliseconds = 345_600_000; const isInPast = new Date(month.year, month.month, 1) < new Date(Date.now() - four_days_in_milliseconds); const monthName = new Date(month.year, month.month - 1, 1).toLocaleString( "default", { month: "long" } ); const weekDaysList: DayOfWeek[] = Object.values(DayOfWeek); return ( <> (

setIsExpanded((e) => !e)} role="button" > {monthName}

)} >
{weekDaysList.map((day) => (
{day} {day.slice(0, 3)}
))}
{month.daysByWeek.map((week, weekIndex) => ( ))}
); };