calcom/cal.com
Schedule
A recurring availability template (e.g., "Mon–Fri 9–5", "Weekend coaching: Sat 10–2"). Defined by the Schedule model and a related Availability model.
Schema highlights
Schedule:
id,userId→Username,timeZoneavailability(relation, manyAvailabilityrows)eventType(relation — event types referencing this as default)selectedCalendarId(optional)dateOverrides(relation —Availabilityrows with explicitdate)
Availability:
id,userId,eventTypeId?,scheduleId?,days(int[]),date?(date override),startTime,endTime
Where it lives in code
| Concern | File |
|---|---|
| Domain | packages/features/schedules |
| Editor UI | apps/web/modules/availability/, packages/features/schedules/components/ |
| Slot consumption | packages/features/slots, packages/lib/availability.ts |
| Out-of-bounds + interval limits | packages/lib/isOutOfBounds.tsx, packages/lib/intervalLimits/, packages/lib/intervalTree.ts |
| Travel schedule overlay | packages/features/travelSchedule |
| Holidays import | packages/features/holidays |
| OOO overlay | packages/features/ooo |
Important behaviors
- Default schedule — a user has a
defaultScheduleIdand event types inherit it unless overridden. - Date overrides — entries with an explicit
dateoverride the recurring pattern for that day. - Travel schedule — temporary timezone shift for traveling organizers.
- Holidays + OOO — additional layers that can block availability without modifying the underlying schedule.
How a slot is generated
See features/scheduling for the full diagram. In short:
- Load schedule + availability rows.
- Subtract date overrides.
- Subtract OOO + holidays.
- Subtract busy times from federated calendars.
- Subtract reserved slots (
SelectedSlotlocks). - Apply event-type period rules (
isOutOfBounds). - Slice into candidate slots at the event-type's length granularity.
Consumers
- Slots and scheduling
- Bookings — booking time validation reads schedules
- Event types — references via the editor
Related pages
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.