Can I limit event booking availability hours #18640
Replies: 1 comment
-
Hey @Shubh-Creates! I'm a bot here to help you with any questions or issues you have. Feel free to ask me anything while waiting for a human maintainer. To create an event that only shows limited booking slots available within the next 2 hours, you can use the import dayjs from "@calcom/dayjs";
import getSlots from "./slots";
const slots = getSlots({
inviteeDate: dayjs.utc(), // Current date and time
frequency: 10, // Frequency of slots in minutes
minimumBookingNotice: 0, // No minimum booking notice
eventLength: 10, // Length of each event in minutes
offsetStart: 0, // No offset
organizerTimeZone: "America/Toronto", // Organizer's time zone
dateRanges: [
{
start: dayjs.utc(), // Start time is now
end: dayjs.utc().add(2, "hours"), // End time is 2 hours from now
},
],
});
console.log(slots); This code sets up a 2-hour window starting from the current time, with 10-minute slots available for booking. You can adjust the To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
-
How can I create an event that only shows limited slots to book within the next 2 hours only?
Beta Was this translation helpful? Give feedback.
All reactions