Skip to content

Commit

Permalink
chore: calendar fixme comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jsun969 committed Sep 22, 2024
1 parent d4c837f commit 24a1b4b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const CalendarBg = ({ currentWeek }: { currentWeek: dayjs.Dayjs }) => {
</div>
))}
</div>
{/* FIXME: Remove the last two grid rows for 21:00 */}
<div className="text-2xs text-apple-gray-500 relative -top-[0.35rem] row-span-full row-start-2 grid grid-cols-subgrid grid-rows-[repeat(15,_minmax(0,_1fr))] pr-2 text-end">
{Array.from({ length: 15 }, (_, i) => (
<div key={i}>{String(7 + i).padStart(2, '0')}:00</div>
Expand All @@ -99,6 +100,10 @@ const CalendarBg = ({ currentWeek }: { currentWeek: dayjs.Dayjs }) => {
);
};

const getGridRow = (time: string) => {
const t = timeToDayjs(time);
return t.hour() * 2 + (t.minute() >= 30 ? 1 : 0) - 13;
};
const CalendarCourses = ({ courses }: { courses: WeekCourse[][] }) => {
return (
<div className="absolute left-10 top-10 grid grid-cols-5 grid-rows-[repeat(28,_minmax(0,_1fr))] z-0">
Expand All @@ -122,10 +127,6 @@ const CalendarCourses = ({ courses }: { courses: WeekCourse[][] }) => {
);
};

const getGridRow = (time: string) => {
const t = timeToDayjs(time);
return t.hour() * 2 + (t.minute() >= 30 ? 1 : 0) - 13;
};
export const Calendar = () => {
const { courses, currentWeek, actions } = useCalendar();

Expand Down

0 comments on commit 24a1b4b

Please sign in to comment.