From 233d103c8729a7d2cd9c1920ca8da48e5ad2dca1 Mon Sep 17 00:00:00 2001 From: Rakshit Yadav Date: Tue, 14 Apr 2026 19:09:39 +0530 Subject: [PATCH 1/2] fix: Disabling autojump of month if there are no slots available in current month Signed-off-by: Rakshit Yadav --- apps/web/modules/bookings/components/DatePicker.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/web/modules/bookings/components/DatePicker.tsx b/apps/web/modules/bookings/components/DatePicker.tsx index 1c1a57efc39b87..e67f581742ab86 100644 --- a/apps/web/modules/bookings/components/DatePicker.tsx +++ b/apps/web/modules/bookings/components/DatePicker.tsx @@ -108,7 +108,8 @@ export const DatePicker = ({ onMonthChange, isLoading: isLoading ?? true, }); - moveToNextMonthOnNoAvailability(); + // Disabled auto-jump to allow users to stay in current month + // moveToNextMonthOnNoAvailability(); // Determine if this is a compact sidebar view based on layout const isCompact = layout !== "month_view" && layout !== "mobile"; From 2bd920f3d9375fe8848b8a6458ab7f9bf60ff7d4 Mon Sep 17 00:00:00 2001 From: Rakshit Yadav Date: Tue, 14 Apr 2026 20:11:19 +0530 Subject: [PATCH 2/2] fix:allow backward calendar navigation after auto-jump on initial load Signed-off-by: Rakshit Yadav --- apps/web/modules/bookings/components/DatePicker.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/web/modules/bookings/components/DatePicker.tsx b/apps/web/modules/bookings/components/DatePicker.tsx index e67f581742ab86..ae0067879aa278 100644 --- a/apps/web/modules/bookings/components/DatePicker.tsx +++ b/apps/web/modules/bookings/components/DatePicker.tsx @@ -1,3 +1,4 @@ +import { useEffect, useRef } from "react"; import { shallow } from "zustand/shallow"; import type { Dayjs } from "@calcom/dayjs"; @@ -108,8 +109,15 @@ export const DatePicker = ({ onMonthChange, isLoading: isLoading ?? true, }); - // Disabled auto-jump to allow users to stay in current month - // moveToNextMonthOnNoAvailability(); + const hasInitialJumpOccurred = useRef(false); + + useEffect(() => { + // Only auto-jump on initial load when data is loaded + if (!isLoading && !hasInitialJumpOccurred.current) { + moveToNextMonthOnNoAvailability(); + hasInitialJumpOccurred.current = true; + } + }, [isLoading]); // Determine if this is a compact sidebar view based on layout const isCompact = layout !== "month_view" && layout !== "mobile";