diff --git a/src/shared/types/CourseMeeting.ts b/src/shared/types/CourseMeeting.ts index 2e8339f8..9b1b4f5e 100644 --- a/src/shared/types/CourseMeeting.ts +++ b/src/shared/types/CourseMeeting.ts @@ -4,13 +4,13 @@ import { Serialized } from 'chrome-extension-toolkit'; * a map of the days of the week that a class is taught, and the corresponding abbreviation */ export const DAY_MAP = { - M: 'Monday', - T: 'Tuesday', - W: 'Wednesday', - TH: 'Thursday', - F: 'Friday', - S: 'Saturday', - SU: 'Sunday', + MON: 'Monday', + TUE: 'Tuesday', + WED: 'Wednesday', + THU: 'Thursday', + FRI: 'Friday', + SAT: 'Saturday', + SUN: 'Sunday', } as const; /** A day of the week that a class is taught */ diff --git a/src/stories/components/CalendarCourseCell.stories.tsx b/src/stories/components/CalendarCourseCell.stories.tsx index 647a766d..8203d74a 100644 --- a/src/stories/components/CalendarCourseCell.stories.tsx +++ b/src/stories/components/CalendarCourseCell.stories.tsx @@ -45,7 +45,7 @@ export const Default: Story = { schedule: new CourseSchedule({ meetings: [ new CourseMeeting({ - days: [DAY_MAP.M, DAY_MAP.W, DAY_MAP.F], + days: [DAY_MAP.MON, DAY_MAP.WED, DAY_MAP.FRI], startTime: 480, endTime: 570, location: { diff --git a/src/views/components/common/CalendarGrid/CalendarGrid.module.scss b/src/views/components/common/CalendarGrid/CalendarGrid.module.scss index a2e208a4..cc2e746f 100644 --- a/src/views/components/common/CalendarGrid/CalendarGrid.module.scss +++ b/src/views/components/common/CalendarGrid/CalendarGrid.module.scss @@ -38,6 +38,7 @@ font-style: normal; font-weight: 500; line-height: normal; + margin-top: 20px; } .timeAndGrid { diff --git a/src/views/components/common/CalendarGrid/CalendarGrid.tsx b/src/views/components/common/CalendarGrid/CalendarGrid.tsx index 582faa9f..ee8605c2 100644 --- a/src/views/components/common/CalendarGrid/CalendarGrid.tsx +++ b/src/views/components/common/CalendarGrid/CalendarGrid.tsx @@ -3,7 +3,7 @@ import styles from './CalendarGrid.module.scss'; import CalendarCell from '../CalendarGridCell/CalendarGridCell'; import { DAY_MAP } from 'src/shared/types/CourseMeeting'; -const daysOfWeek = Object.values(DAY_MAP).filter(d => d != "Saturday" && d != "Sunday") +const daysOfWeek = Object.keys(DAY_MAP).filter(key => !['SAT', 'SUN'].includes(key)); const hoursOfDay = Array.from({ length: 14 }, (_, index) => index + 8); const grid = Array.from({ length: 5 }, () => Array.from({ length: 13 }, (_, columnIndex) => ( @@ -30,7 +30,7 @@ const Calendar: React.FC = (props) => { {hoursOfDay.map((hour) => (
{hour % 12 === 0 ? 12 : hour % 12}:00 {hour < 12 ? 'AM' : 'PM'}
+{hour % 12 === 0 ? 12 : hour % 12} {hour < 12 ? 'AM' : 'PM'}