Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dull-carpets-help.md
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions docs/platform/atoms/booker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
9 changes: 8 additions & 1 deletion packages/platform/atoms/booker/BookerPlatformWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const BookerPlatformWrapper = (
isBookingDryRun,
handleSlotReservation,
onTimeslotsLoaded,
startTime: customStartTime,
} = props;
const layout = BookerLayouts[view];

Expand Down Expand Up @@ -220,14 +221,20 @@ export const BookerPlatformWrapper = (
: undefined;
const { timezone } = useTimePreferences();

const [startTime, endTime] = useTimesForSchedule({
const [calculatedStartTime, calculatedEndTime] = useTimesForSchedule({
month,
monthCount,
dayCount,
prefetchNextMonth,
selectedDate,
});

const startTime =
customStartTime && dayjs(customStartTime).isAfter(dayjs(calculatedStartTime))
? dayjs(customStartTime).toISOString()
: calculatedStartTime;
const endTime = calculatedEndTime;

const [routingParams, setRoutingParams] = useState<{
routedTeamMemberIds?: number[];
_shouldServeCache?: boolean;
Expand Down
1 change: 1 addition & 0 deletions packages/platform/atoms/booker/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading