Skip to content
Star

Calendar state

Handle navigation, event edits, and timezone changes in your app.

Pass events into the view

Pass events, date, and timeZone to Calendar. Update those values in response to navigation and edit callbacks. For changes outside the view, changeCalendarEvent returns a proposed event from Calendar core.

Apply and save an edit

Use onEventChange(next, { previous, action }) for view edits. Replace the item with next in your app state and save it. Keep previous so you can restore it if the save fails.

apply-calendar-edit.ts

editable and onEventChange are both required for view drag or keyboard edits; an individual event with editable: false cannot be changed. snapDuration defaults to 15 minutes and bounds resize duration. changeCalendarEvent throws for non-finite deltas, non-positive snapping, disabled edits, point-event resizing, a duration shorter than the snap interval, or a timed resize outside its original local day unless date resizing is enabled. The view ignores invalid gesture proposals rather than sending them to onEventChange.

During a pointer edit, the original stays visible and a candidate shows the proposed position and duration. Escape, pointer cancellation, leaving the Calendar, or changing its inputs cancels the proposal. A valid release emits one change. Touch scrolling on the event body does not move it; use the event’s Edit action and a caller-owned date/time form. Points and very short events use this explicit editor rather than overlapping resize handles.

Respond to selection and navigation

Selection callbacks identify an event or slot. onDateChange, onViewChange, and onTimeZoneChange report navigation requests; update the corresponding controlled prop in response. onEventResponse, onEventAction, and onSchedulingResponse report decisions about event metadata. They do not execute a server action, authorize it, or update a backend. Keep pending, failed, and conflict status in the caller's event data and present truthful feedback.

Creator, organizer, invitation response, proposed changes and execution status are separate fields. Answering an invitation should not discard a pending time proposal. Accepting a proposal should update only the fields it changes. Keep stable IDs and reject stale asynchronous results when a newer decision supersedes them.

A selected timed slot includes offset timestamps and has slotDuration minutes (default 30); pointer and keyboard selection snap by snapDuration (default 15). A slot can be shorter than the requested duration only when the local day has fewer remaining minutes. Resource schedule slots carry resourceId; unassigned slots omit it.

Timezone and DST

Changing the timezone changes where events appear while keeping the stored instant. Moving an event by local days preserves its starting clock time and elapsed duration when the new start is unique. The core throws if a daylight-saving change makes that start missing or ambiguous. Resolve the new start in your app before saving. Across a transition, the ending clock time can change.

Customize event layout and inspection

Calendar owns layout, overflow disclosure and inspection of the supplied events. Those view decisions do not change event identity, semantic intervals or the caller's collection. The application owns the editing form and persistence feedback. Use renderEvent to customize event content or onEventEdit to open an application editor; use the Calendar component documentation for density, sizing, inspection and responsive behavior. Core getCalendarDates returns 42 dates for Month; the React view renders five or six weeks as needed.

Schedule recurring events in your app

Pass individual occurrences to Calendar after your app expands a recurrence rule. Check availability, resolve domain conflicts, and save edits in your app. See the core API for event calculations and the React component for view behavior.

Timeline display scale

Use view="timeline" for a vertical unit axis and optional resource columns. timeScale configures axis units, step and count; it never rewrites the supplied events. The caller applies view changes and should provide a compatible scale for the new view. Timeline inspection and caller-owned Edit remain available; long-range pointer/keyboard resizing is not inferred from a minute-based snap setting.

Calendar-unit navigation advances by the visible range. Clock-unit Timeline navigation advances one local date because the anchor remains a date-only value. slotDuration and snapDuration continue to describe creation and edit increments in hour-grid views.