mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 23:58:31 -06:00
handling iso date strings
This commit is contained in:
27
nextjs/src/app/course/[courseName]/page.tsx
Normal file
27
nextjs/src/app/course/[courseName]/page.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
"use client";
|
||||
import { useLocalCourseDetailsQuery } from "@/hooks/localCoursesHooks";
|
||||
import { getDateFromStringOrThrow } from "@/models/local/timeUtils";
|
||||
|
||||
export default function Page({
|
||||
params: { courseName },
|
||||
}: {
|
||||
params: { courseName: string };
|
||||
}) {
|
||||
const { data: course } = useLocalCourseDetailsQuery(courseName);
|
||||
console.log(course);
|
||||
|
||||
const startDate = getDateFromStringOrThrow(course.settings.startDate);
|
||||
const endDate = getDateFromStringOrThrow(course.settings.endDate);
|
||||
|
||||
const months = calendarMonthUtils.getMonthsBetweenDates(startDate, endDate);
|
||||
return (
|
||||
<div>
|
||||
{course.settings.name}
|
||||
<div>
|
||||
{months.map((month) => (
|
||||
<div key={month.month + "" + month.year}>{month.month}</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user