"use client"; import { CalendarMonthModel } from "./calendarMonthUtils"; import { DayOfWeek } from "@/models/local/localCourse"; import Day from "./day/Day"; import { Expandable } from "@/components/Expandable"; export const CalendarMonth = ({ month }: { month: CalendarMonthModel }) => { const weekInMilliseconds = 604_800_000; const isInPast = new Date(month.year, month.month, 1) < new Date(Date.now() - weekInMilliseconds); 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}
))}
{month.daysByWeek.map((week, weekIndex) => ( ))}
); }; function CalendarWeek({ week, monthNumber, }: { week: string[]; //date strings monthNumber: number; }) { return (
{week.map((day, dayIndex) => ( ))}
); }