From 7c9aae7eafdaead43b856bca33dc02270c165e8b Mon Sep 17 00:00:00 2001 From: Benny Joo Date: Thu, 3 Apr 2025 07:40:28 -0400 Subject: [PATCH] selectedDateString could be null (#20517) --- packages/features/bookings/Booker/components/Header.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/features/bookings/Booker/components/Header.tsx b/packages/features/bookings/Booker/components/Header.tsx index 7ca86d6e00..b76ac83e0a 100644 --- a/packages/features/bookings/Booker/components/Header.tsx +++ b/packages/features/bookings/Booker/components/Header.tsx @@ -41,8 +41,8 @@ export function Header({ const setSelectedDate = useBookerStore((state) => state.setSelectedDate); const addToSelectedDate = useBookerStore((state) => state.addToSelectedDate); const isMonthView = layout === BookerLayouts.MONTH_VIEW; - const selectedDate = dayjs(selectedDateString); const today = dayjs(); + const selectedDate = selectedDateString ? dayjs(selectedDateString) : today; const selectedDateMin3DaysDifference = useMemo(() => { const diff = today.diff(selectedDate, "days"); return diff > 3 || diff < -3;