diff --git a/components/wizard/calendar.tsx b/components/wizard/calendar.tsx index 94f5cd3..435138a 100644 --- a/components/wizard/calendar.tsx +++ b/components/wizard/calendar.tsx @@ -1,6 +1,12 @@ import React, { useContext } from 'react' import classnames from 'classnames' -import { isPast, isSameDay, isAfter, isWithinInterval } from 'date-fns' +import { + isPast, + isSameDay, + isAfter, + isWithinInterval, + endOfDay, +} from 'date-fns' import useSWR from 'swr' import Calendar from 'react-calendar' import { dateFormatBackend } from '../../helpers/date' @@ -42,7 +48,7 @@ export default function MyCalendar({ ...props }) { function tileClassName({ date, view }) { const isMonthView = view === 'month' const isDaysBookedLoaded = !!daysBooked - const isInPast = isPast(date) + const isInPast = isPast(endOfDay(date)) const isBooked = daysBooked?.includes(dateFormatBackend(date)) return classnames({ 'react-calendar__tile--past': isMonthView && isInPast,