Skip to content

Scheduling infrastructure for absolutely everyone.

feat: add optional startTime prop to BookerPlatformWrapper (#22731)

devin-ai-integration[bot]ef6618743d5c
diff --git a/.changeset/dull-carpets-help.md b/.changeset/dull-carpets-help.md
new file mode 100644
index 00000000000..1227871c663
--- /dev/null
+++ b/.changeset/dull-carpets-help.md
@@ -0,0 +1,5 @@
+---
+"@calcom/atoms": patch
+---
+
+Added new startTime prop to the Booker component that allows users to decide the first available date when the booker loads
diff --git a/docs/platform/atoms/booker.mdx b/docs/platform/atoms/booker.mdx
index 75962bced91..0a980ec1bf8 100644
--- a/docs/platform/atoms/booker.mdx
+++ b/docs/platform/atoms/booker.mdx
@@ -90,6 +90,7 @@ Below is a list of props that can be passed to the booker atom.
| customClassNames | No | To pass in custom classnames from outside for styling the atom |
| month | No | The exact month for displaying a user's availability; defaults to the current month |
| selectedDate | No | Default selected date for which the slot picker opens |
+| startTime | No | Custom start time for the Booker that allows users to decide the first available date. Accepts JavaScript Date object or date string in format `YYYY-MM-DD` (e.g., `"2025-08-20"` or `new Date("2025-08-20")`) |
| hideBranding | No | For hiding any branding on the booker |
| isAway | No | Sets the booker component to the away state |
| allowsDynamicBooking | No | Boolean indicating if the booking is a dynamic booking |
diff --git a/packages/platform/atoms/booker/BookerPlatformWrapper.tsx b/packages/platform/atoms/booker/BookerPlatformWrapper.tsx
index 38d06c8b6cd..9de9a0d0259 100644
--- a/packages/platform/atoms/booker/BookerPlatformWrapper.tsx
+++ b/packages/platform/atoms/booker/BookerPlatformWrapper.tsx
@@ -57,6 +57,7 @@ export const BookerPlatformWrapper = (
isBookingDryRun,
handleSlotReservation,
onTimeslotsLoaded,
+ startTime: customStartTime,
} = props;
const layout = BookerLayouts[view];
@@ -220,7 +221,7 @@ export const BookerPlatformWrapper = (
: undefined;
const { timezone } = useTimePreferences();
- const [startTime, endTime] = useTimesForSchedule({
+ const [calculatedStartTime, calculatedEndTime] = useTimesForSchedule({
month,
monthCount,
dayCount,
@@ -228,6 +229,12 @@ export const BookerPlatformWrapper = (
selectedDate,
});
+ const startTime =
+ customStartTime && dayjs(customStartTime).isAfter(dayjs(calculatedStartTime))
+ ? dayjs(customStartTime).toISOString()
+ : calculatedStartTime;
+ const endTime = calculatedEndTime;
+
const [routingParams, setRoutingParams] = useState<{
routedTeamMemberIds?: number[];
_shouldServeCache?: boolean;
diff --git a/packages/platform/atoms/booker/types.ts b/packages/platform/atoms/booker/types.ts
index 574214fcc1e..e10542fd895 100644
--- a/packages/platform/atoms/booker/types.ts
+++ b/packages/platform/atoms/booker/types.ts
@@ -83,6 +83,7 @@ export type BookerPlatformWrapperAtomProps = Omit<
isBookingDryRun?: boolean;
eventMetaChildren?: React.ReactNode;
onTimeslotsLoaded?: (slots: Record<string, Slot[]>) => void;
+ startTime?: string | Date;
};
type VIEW_TYPE = keyof typeof BookerLayouts;