diff --git a/packages/page-calendar/src/Day.tsx b/packages/page-calendar/src/Day.tsx index 7977055602..ad5a8c68dc 100644 --- a/packages/page-calendar/src/Day.tsx +++ b/packages/page-calendar/src/Day.tsx @@ -16,8 +16,11 @@ import { useTranslation } from './translate'; interface Props { className?: string; date: Date; + hasNextDay: boolean; now: Date; scheduled: EntryInfo[]; + setNextDay: () => void; + setPrevDay: () => void; } const HOURS = ((): number[] => { @@ -30,16 +33,14 @@ const HOURS = ((): number[] => { return hours; })(); -const NOOP = () => undefined; - -function Day ({ className, date, now, scheduled }: Props): React.ReactElement { +function Day ({ className, date, hasNextDay, now, scheduled, setNextDay, setPrevDay }: Props): React.ReactElement { const { t } = useTranslation(); const monthRef = useRef(MONTHS.map((m) => t(m))); const [isToday, nowHours, nowMinutes] = useMemo( () => [ - date.getDate() === now.getDate() && date.getMonth() === now.getMonth() && date.getFullYear() === now.getFullYear(), + date.getMonth() === now.getMonth() && date.getFullYear() === now.getFullYear() && date.getDate() === now.getDate(), now.getHours(), now.getMinutes() ], @@ -51,14 +52,14 @@ function Day ({ className, date, now, scheduled }: Props): React.ReactElement