From fbfde530d8d5739853d5418f3c71a690ca99451f Mon Sep 17 00:00:00 2001 From: Alex Mickelson Date: Fri, 27 Sep 2024 12:55:21 -0600 Subject: [PATCH] display in semester --- README.md | 21 +++++++------------ .../course/[courseName]/calendar/day/Day.tsx | 15 ++++++++++++- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 64dbf8f..4b18042 100644 --- a/README.md +++ b/README.md @@ -22,28 +22,20 @@ matching questions - different delimiter (-n in answer messes things up) - add distractors - on calendar month, displays days that are on the same week as a month change (if month ends on monday, still show tues-sat) file uploads - image compression? - scrape html, when image embedded, upload to canvas and add img tag to canvas asset in html before sending image - -add grade percentage support in page - -wait until week two before colapsing previous month? - -better ux around course settings (assignment groups, term for start/end) - -display queue of canvas requests +- put all images in an image repo in a /course/semester/filename format. upload the image to canvas, replace the url before sending it over with the canvas version. + - store canvas image ids in settings? allow multiple courses to be edited concurrently in different browser tabs have lock date mimic an offset after drag and drop changes due date -make the ux easier to change course pages - schedule planning view? just outline concepts? (maybe some non-canvas scheduled thing that only shows up in planner? like a note, could be de-emphasized in webpage) +- probably have a notes section for each module. Have a toggle to expand notes in module holiday schedule @@ -51,6 +43,7 @@ multi-seciton support for due dates/times better error handling when files are unparseable -## monaco PR? - - \ No newline at end of file +new settings +- default submission types +- default file types +- default lockAt offset \ No newline at end of file diff --git a/nextjs/src/app/course/[courseName]/calendar/day/Day.tsx b/nextjs/src/app/course/[courseName]/calendar/day/Day.tsx index 7a67225..f64f403 100644 --- a/nextjs/src/app/course/[courseName]/calendar/day/Day.tsx +++ b/nextjs/src/app/course/[courseName]/calendar/day/Day.tsx @@ -1,5 +1,6 @@ "use client"; import { + getDateFromString, getDateFromStringOrThrow, getDateOnlyMarkdownString, } from "@/models/local/timeUtils"; @@ -31,7 +32,19 @@ export default function Day({ day, month }: { day: string; month: number }) { const isInSameMonth = dayAsDate.getMonth() + 1 == month; const classOnThisDay = settings.daysOfWeek.includes(getDayOfWeek(dayAsDate)); - const meetingClasses = classOnThisDay ? " bg-slate-900 " : " "; + const semesterStart = getDateFromStringOrThrow( + settings.startDate, + "comparing start date in day" + ); + const semesterEnd = getDateFromStringOrThrow( + settings.endDate, + "comparing end date in day" + ); + + const isInSemester = semesterStart < dayAsDate&& semesterEnd > dayAsDate; + + const meetingClasses = + classOnThisDay && isInSemester ? " bg-slate-900 " : " "; const monthClass = isInSameMonth ? isToday ? " border border-blue-700 shadow-[0_0px_10px_0px] shadow-blue-500/50 "