Scheduler API
Complete API reference for @oge-ui/scheduler. The layout kernel — view-model builders, the transitive-overlap column layout, lane packing, gesture math and the RFC 5545 RRULE-subset parser — is pure TypeScript in @oge-ui/scheduler-engine, shared with the React scheduler; live demos are on the overview page.
Properties Methods Events Types
OgeScheduler
oge-schedulerProperties 48
Data
| Name | Type | Default | Description |
|---|---|---|---|
dataSource | readonly T[] | DataSource<T> | OgeSchedulerDataSource<T> | null | null | Appointment items: a plain array (copied into an internal working set — the input is never mutated), any @oge-ui/core DataSource (loaded once; with remoteFiltering per visible range) or an OgeSchedulerDataSource loaded per visible range: load({ startDate, endDate, resources?, signal }) runs for the period on screen, the previous and next periods are prefetched, navigation is debounced (debounce, 150 ms), stale requests are aborted through signal and every range is cached (cacheSize, 12). A visible status line and aria-busy show the load. CRUD goes through the source's insert/update/remove when present (the range reloads afterwards). |
remoteFiltering | boolean | false | Loads a filtering @oge-ui/core DataSource per visible range: load() receives a filter on the date fields (appointments overlapping the range, or any recurring series) and the signal of the range. |
keyExpr | string | ((item: T) => unknown) | 'id' | Key field or selector; items without a resolvable key fall back to their index. |
textExpr / startDateExpr / endDateExpr / allDayExpr / colorExpr / locationExpr / descriptionExpr / disabledExpr | string | ((item: T) => unknown) | 'text' / 'startDate' / … | Field mapping: names (dotted paths reach nested objects) or getter functions. String dates parse as local wall time and write back in the same storage shape. |
recurrenceRuleExpr / recurrenceExceptionExpr | string | ((item: T) => unknown) | 'recurrenceRule' / 'recurrenceException' | Recurrence fields: rules in the documented RFC 5545 subset expand into occurrence instances in every view; exceptions are comma-separated EXDATE stamps. |
reminderExpr | string | ((item: T) => unknown) | 'reminder' | Minutes before the start a reminder fires (see reminderTriggered) — OGE extra (Outlook parity). |
startTimeZoneExpr / endTimeZoneExpr | string | ((item: T) => unknown) | 'startTimeZone' / 'endTimeZone' | An appointment’s own IANA zones. A series recurs on its start zone’s clocks (a DTSTART;TZID= in the rule wins), so “09:00 New York” stays 09:00 there across DST while the display shifts; the editor shows and saves the dates in these zones with showTimeZoneEditor. Unknown names are ignored. |
resources | readonly OgeSchedulerResource[] | [] | Resource kinds ({ fieldExpr, items, label?, useColorAsDefault? }): editor select fields, default appointment colors and timeline rows. |
groups | readonly string[] | [] | Resource fields grouping the views, outermost first — ['roomId', 'ownerId'] nests owners inside rooms (multi-level, nested headers): day/week columns or row blocks, timeline rows with group header rows. Grouped cells prefill every level on create, and drags across columns / rows / blocks reassign them. |
groupOrientation | 'horizontal' | 'vertical' | undefined | undefined | How grouped resources lay out: side by side, or stacked — day/week row blocks (a group label column, every block a full time grid) and the timeline rows. Unset = horizontal for day/week, vertical for the timelines; a view option’s own groupOrientation wins. Horizontal timelines lay the leaves out as blocks of one track. |
groupByDate | boolean | true | Horizontal day/week grouping is date-major (each day split into its resources — the 1.x layout) or, with false, resource-major (each resource’s days side by side, the all-day strip packed per resource). |
disabledSlots | OgeSchedulerDisabledSlots | null | null | Non-bookable slots — a predicate (date, resources) => boolean or a list of { startDate, endDate, resources?, recurrenceRule?, text? } ranges (lunch every weekday, a room under maintenance). Rendered hatched with aria-disabled and an "unavailable" suffix; create, move, resize, paste and drop are refused there and announced. |
recurrenceEditMode | 'dialog' | 'occurrence' | 'series' | 'dialog' | How edits to a recurring occurrence apply: ask per action, always detach the occurrence (EXDATE + standalone copy), or always change the series. |
Date & views
| Name | Type | Default | Description |
|---|---|---|---|
currentDate | Date | new Date() | Anchor date of the visible period. Two-way ([(currentDate)]); writes clamp into [min, max]. |
timeZone | string | undefined | undefined | The display zone (IANA, e.g. 'Europe/Istanbul'); unset = the browser’s. Stored dates stay instants: every slot, day boundary (23- and 25-hour DST days, skipped and repeated hours), drag snap, “today” line and recurrence expansion follows this zone’s clocks, computed with Intl.DateTimeFormat offsets (core’s ogeZonedParts / ogeFromZoned) — no time-zone database. Events, currentDate writes and item patches carry instants; all-day appointments stay on their calendar days. |
showTimeZoneEditor | boolean | false | Adds start / end time-zone pickers to the appointment editor: the date boxes then show the appointment’s own zones (an empty picker follows the scheduler’s zone), and the typed time is saved in the picked zone. |
currentView | 'day' | 'week' | 'workWeek' | 'month' | 'agenda' | 'timelineDay' | 'timelineWeek' | 'timelineWorkWeek' | 'timelineMonth' | 'timelineYear' | 'year' | 'week' | The active view. Two-way ([(currentView)]). The month and year timelines run at day scale (one column per day, bars snap to days). |
views | readonly (OgeSchedulerView | OgeSchedulerViewOptions)[] | ['day', 'week', 'month'] | View-switcher entries; option objects override name, dayStartHour, dayEndHour, cellDuration and groupOrientation per view, and intervalCount makes custom N-day / N-week / N-month views ({ type: 'day', intervalCount: 3, name: '3 days' }); navigation steps by the whole interval. Entries sharing a type are told apart by the switcher. |
showWeekNumbers | boolean | false | Week numbers in the month rows and the day/week header corner (W32, W32–33 for a fortnight); the grid label carries the spoken text. |
weekNumberRule | 'iso' | 'locale' | 'iso' | ISO 8601 (Monday-first, 4-day rule) or the locale’s own numbering — the first day of week and Intl.Locale minimal days (US: Sunday-first, the week holding January 1st is week 1). |
moreMode | 'popup' | 'drill' | 'popup' | What a month "+N more" does: open a keyboard-accessible popup list of the day (Tab-reachable button, focus moves in, Up/Down/Home/End, Enter opens an entry, Escape returns, a "Go to day" action) or drill into the day view. |
virtualScrolling | boolean | 'auto' | 'auto' | Timeline row virtualization for many resources — rows render at fixed heights on core’s offset tree, so the window is exact; 'auto' turns it on above 50 rows. The axis headers stay sticky. |
adaptiveView | boolean | { breakpoint?: number; view?: OgeSchedulerView } | false | Switches the visible view to view (agenda) when the scheduler's own width — a ResizeObserver, never the window — drops below breakpoint (600px), and back to the previous view when it grows again. The switch writes currentView like a user pick, on crossings only, so the switcher keeps working at any width and a view picked while narrow wins. |
min / max | Date | undefined | — | Navigable date bounds: navigation buttons disable at the edges and every date write clamps. |
firstDayOfWeek | number | undefined | — | First day of week (0 = Sunday); undefined resolves from the locale via Intl.Locale.weekInfo. |
weekendDays | readonly number[] | undefined | — | Weekend days (0 = Sunday … 6 = Saturday) the day/week, month and timeline views shade and the workWeek view drops. undefined resolves from the locale via Intl.Locale#getWeekInfo() (Friday + Saturday in he-IL), falling back to Saturday + Sunday. |
hiddenWeekDays | readonly number[] | undefined | — | Weekdays removed from the week views; the workWeek view always drops the weekend on top. |
dayStartHour / dayEndHour / cellDuration | number | 0 / 24 / 30 | Visible hour window and slot raster (minutes) of the time grids. |
agendaDuration | number | 7 | Days the agenda view lists from the anchor date. |
scrollTime | number | undefined | — | Initial scroll position of the day/week body in hours (fractions allowed, e.g. 8.5); re-applied on view/period changes. |
rtlEnabled | boolean | undefined | undefined | Right-to-left layout: day columns, month cells and the timeline run right-to-left (the first day is the rightmost column), the toolbar chevrons flip, Left/Right (and Ctrl+Left/Right moves) mirror and horizontal drag deltas invert. Unset follows the page — ogeResolveDirection reads the computed direction or the nearest dir attribute after the first render and observes later dir changes; an explicit value also sets dir on the host. |
Behavior
| Name | Type | Default | Description |
|---|---|---|---|
allowAdding / allowUpdating / allowDeleting / allowDragging / allowResizing | boolean | true | Per-capability editing gates. |
readOnly | boolean | false | Display-only shorthand: overrides every allow* flag at once and hides the editing affordances. The day/week and month grids then carry aria-readonly="true" (also when every allow* flag is off). |
snapDuration | number | undefined | — | Drag/resize snap raster in minutes; defaults to cellDuration. |
workHours | OgeSchedulerWorkHours | null | null | Working-hours emphasis: cells outside { start, end, days? } get the off-hours shading. A resource item’s own workHours / workDays win for its grouped columns, rows and blocks (the innermost level that sets them). |
snapToWorkHours | boolean | false | Clamps timed moves, drag-to-create ranges and drops into the target’s working hours (keeping the length when it fits). |
allowOverlap | boolean | true | false refuses a create / move / resize / paste / drop that overlaps another appointment — on the same resource when grouped, recurring series expanded; the change is cancelled with a visible notice and an announcement. |
conflictCheck | (appointment: T, conflicts: readonly OgeSchedulerAppointment<T>[]) => boolean | — | Decides overlapping changes: return true to let one land. Wins over allowOverlap. |
selectedAppointments | readonly T[] | [] | The selected items, two-way ([(selectedAppointments)]): Ctrl/⌘-click toggles, Shift-click extends over the chip order, a plain click replaces; Ctrl+Space / Shift+Space from the keyboard. Selected chips get an accent ring and a "selected" suffix; Ctrl+C copies the selection. |
undoLimit | number | 50 | Undo steps kept for Ctrl/⌘+Z and Ctrl/⌘+Y (Ctrl/⌘+Shift+Z). One user action — a move, a paste, a detached occurrence — is one step; an undo replays through the normal cancelable pipelines. 0 turns undo off. |
showAddButton | boolean | true | Shows the toolbar "new appointment" button (Outlook parity) — creation without double-click; hidden while readOnly or allowAdding=false. |
showAllDayPanel | boolean | true | Shows the all-day strip in the day/week views. |
showCurrentTimeIndicator | boolean | true | The accent now-line in today's column. |
shadeUntilCurrentTime | boolean | false | Dims today's column above the now-line. |
maxAppointmentsPerCell | number | 'auto' | 'auto' | Month-view lane budget per cell; the overflow folds into a "+N more" button (see moreMode). |
locale | string | undefined | — | BCP 47 locale for every Intl format; defaults to the browser locale. |
messages | Partial<OgeSchedulerMessages> | {} | Per-instance message overrides, merged over the DI config per top-level block. |
dateNavigatorText | (start: Date, end: Date, view: OgeSchedulerView) => string | — | Custom period-title formatter for the toolbar. |
Methods 21
| Name | Type | Description |
|---|---|---|
addAppointment(appointmentData) | void | Inserts programmatically through the same cancelable appointmentAdding pipeline as interactive creation. |
updateAppointment(appointmentData, patch) | void | Applies a patch through the guarded update pipeline. |
deleteAppointment(appointmentData) | void | Deletes through the guarded delete pipeline. |
showAppointmentPopup(appointmentData?, createNew?) | void | Opens the editing form — prefilled create form with createNew/no data, edit form otherwise (dx parity: the method opens the form). |
hideAppointmentPopup() | void | Closes the editor dialog and the summary popup. |
scrollToTime(hours, minutes?) | void | Scrolls the day/week body to the given time of day. |
scrollTo(date) | void | Navigates to date and scrolls to its time of day. |
getStartViewDate() / getEndViewDate() | Date | First moment / exclusive end of the visible period, as instants (with timeZone, the zone’s midnights — a DST day is 23 or 25 hours long). |
getDataSource() | readonly T[] | DataSource<T> | OgeSchedulerDataSource<T> | null | The bound data source, as given. |
reload() | void | Reloads the data source: a load-once DataSource loads again, a range source drops its cache and reloads the visible range. |
focus() | void | Focuses the active view's grid (roving cell). |
goToday() / navigate(direction) | void | Toolbar equivalents: jump to today / step one period (respects min/max). |
copyAppointments(appointment?) / pasteAppointments(target) | number | The clipboard (what Ctrl+C on a chip and Ctrl+V on a cell do): copies the selection — or appointment when it is not part of it — and pastes so the earliest copy starts at target.date ({ date, allDay, values }), keys dropped, a grouped target’s resources applied, each copy through the guarded insert pipeline, all as one undo step. Return the count. |
clearSelection() | void | Empties selectedAppointments. |
undo() / redo() | boolean | Reverts / re-applies the last scheduler edit (the Ctrl+Z / Ctrl+Y keys); false when there is none. |
canUndo() / canRedo() | boolean | Whether a step is available (reactive). |
getExportData(range?) | OgeSchedulerExportData<T> | The export model the /export-* entries read: every appointment (series unexpanded) plus the expanded, chronological rows of range — the visible period by default. |
print(options?) | Promise<void> | Prints the current view: the scheduler cloned with the page’s stylesheets into a hidden frame (scroll areas expanded), then the browser’s print dialog. options: title (the print document’s title) and nonce — the CSP nonce stamped on the print sheet <style>; defaults to Angular’s CSP_NONCE, else the nonce of the page’s own nonce’d elements, so a nonce-only style-src admits it. |
Import / export (lazy secondary entries)
| Name | Type | Description |
|---|---|---|
exportToICalendar(scheduler, options?) / importICalendar(scheduler, text, options?) | @oge-ui/scheduler/export-ical | No dependencies — RFC 5545 .ics export (downloads unless download: false, returns the text): one VEVENT per appointment with UID, DTSTAMP, DTSTART/DTEND (VALUE=DATE + exclusive end for all-day), RRULE, RDATE, EXDATE, TEXT escaping and 75-octet folding. The import reads DURATION, UTC values, RECURRENCE-ID overrides (folded into the series as EXDATE + a standalone item) and maps every event through the *Expr field names into addAppointment. Floating local time — time zones are a later release. |
exportSchedulerToPdf(scheduler, options?) / buildSchedulerPdfDocument(data, options?) | @oge-ui/scheduler/export-pdf | Lazy PDF list export (jspdf peer): the period’s appointments grouped by day (time, subject, location, resources), paginated with the header repeated. Text outside WinAnsi needs a Unicode TrueType font — per export, or once via setOgePdfDefaultFont() from @oge-ui/behavior. |
exportSchedulerToExcel(scheduler, options?) / buildSchedulerExcelWorkbook(data, options?) | @oge-ui/scheduler/export-excel | Lazy Excel list export (exceljs peer): one row per appointment / occurrence with typed Date cells, all-day and recurring columns and one column per resource kind. |
Events 11
Editing (cancelable pipeline)
| Name | Type | Description |
|---|---|---|
appointmentAdding / appointmentUpdating / appointmentDeleting | OgeSchedulerAppointment*ingEvent<T> | Cancelable pre-events — set cancel = true to veto before the store changes. |
appointmentAdded / appointmentUpdated / appointmentDeleted | OgeSchedulerAppointment*edEvent<T> | Fired only for applied changes — persist from these when binding plain arrays. |
editorShowing | OgeSchedulerEditorShowingEvent<T> | Cancelable, before the editor opens; replace formItems to customize the form (dx onAppointmentFormOpening parity). |
Reminders
| Name | Type | Description |
|---|---|---|
reminderTriggered | OgeSchedulerReminderEvent<T> | Fires once per occurrence when start − reminder minutes is reached (checked about every 30 s while mounted) — OGE extra. |
Interaction
| Name | Type | Description |
|---|---|---|
appointmentClick / appointmentDblClick | OgeSchedulerAppointmentClickEvent<T> | Chip clicks; single click also opens the popup, double click the editor. |
cellClick / cellDblClick | OgeSchedulerCellClickEvent | Empty-cell clicks; double click also opens the prefilled create editor. |
appointmentContextMenu / cellContextMenu | OgeSchedulerAppointmentClickEvent<T> / OgeSchedulerCellClickEvent | Right-clicks with full payloads. A built-in context menu also opens (chip: edit/delete through the guarded pipelines incl. recurrence scope; cell: new appointment prefilled at that slot — labels in messages.menu); listen to these events to add your own entries alongside it. |
rangeSelected | OgeSchedulerRangeSelectedEvent | A drag-to-create cell-range selection landed; the prefilled create editor opens next. |
appointmentDropped | OgeSchedulerAppointmentDroppedEvent<T> | An [ogeSchedulerDraggable] item — or another scheduler’s appointment — was dropped in (pointer, touch, or the keyboard twin); the built item went through appointmentAdding. Payload: itemData, appointmentData, startDate/endDate/allDay, the slot’s resources and added. |
dragOut | OgeSchedulerDragOutEvent<T> | An appointment was dragged out of the scheduler and released: appointment, appointmentData, the pointer, the target under it and droppedOnScheduler (another scheduler added a copy) — the app decides whether to remove it here. |
currentDateChange / currentViewChange / selectedAppointmentsChange | Date / OgeSchedulerView / readonly T[] | The two-way model outputs. |
Types 14
| Name | Type | Description |
|---|---|---|
OgeSchedulerAppointment<T> | interface | The normalized appointment: key, source (the original item), text, startDate/endDate, allDay, color, description, recurrence fields and disabled. |
OgeSchedulerViewOptions | interface | Per-view overrides: type, name, dayStartHour, dayEndHour, cellDuration, intervalCount, groupOrientation. |
OgeSchedulerWorkHours | interface | { start, end, days? } — the emphasized working hours. |
OgeSchedulerResourceItem | interface | { id, text, color?, workHours?, workDays? } — one assignable resource; its own working hours shade its grouped columns / rows. |
OgeSchedulerDisabledSlots / OgeSchedulerBlockedRange | type / interface | A predicate (date, resources) => boolean or a list of { startDate, endDate, resources?, recurrenceRule?, text? } — resources limits a range to { field: id | id[] }. |
OgeSchedulerConflictCheck<T> | type | (appointment, conflicts) => boolean — true lets an overlapping change land. |
OgeSchedulerAppointmentDroppedEvent<T> / OgeSchedulerDragOutEvent<T> | interface | The drag-in / drag-out payloads (see the events). |
OgeSchedulerDataSource<T> / OgeSchedulerLoadOptions | interface | { load(options), insert?, update?, remove?, debounce?, prefetch?, cacheSize? } — the range source; load receives { startDate, endDate, resources?, signal } (instants, resources = the grouped ids on screen) and resolves to the items overlapping the range (series included). |
ogeZonedParts / ogeFromZoned / ogeTzOffset / ogeToWallClock / ogeFromWallClock | function (@oge-ui/core) | The zoned date math the scheduler and the Gantt share: an instant’s fields on a zone’s clocks, the instant of a wall time (skipped times move forward, repeated ones take the earlier side unless disambiguation says otherwise), the offset in minutes, and the wall-clock frame conversions — all Intl, DST-exact. |
OgeSchedulerExportData<T> | interface | { title, rangeStart, rangeEnd, locale, rows, appointments, fields, resources, messages } — what getExportData() returns and the export builders read. |
OgeResourceHeaderTemplate | structural directive [ogeResourceHeaderTemplate] | Replaces the grouped resource headers (day/week column headers, vertical group labels, timeline row heads and group rows — dx resourceCellTemplate parity); context { $implicit: OgeSchedulerResourceItem, resource, level, view }. |
[ogeAppointmentTemplate] | structural directive | Replaces the chip content; context { $implicit: OgeSchedulerAppointment<T>, view }. |
OgeSchedulerCellTemplate | structural directive [ogeCellTemplate] | OGE extra — custom empty-cell content; context { $implicit: Date, view, allDay }. |
OgeDateHeaderTemplate | structural directive [ogeDateHeaderTemplate] | OGE extra — custom date-header content; context { $implicit: Date, view }. |
OgeSchedulerDraggable
[ogeSchedulerDraggable]Properties 3
| Name | Type | Description |
|---|---|---|
ogeSchedulerDraggable | unknown | The item a drop turns into an appointment — its fields are kept and start / end / all-day plus the slot’s resources are written through the target scheduler’s *Expr field names. The host becomes a role="button" tab stop. |
ogeSchedulerDraggableDuration | number | undefined | Appointment length in minutes; omitted = the target’s cell duration (whole days on day-scale targets). |
ogeSchedulerDraggableText | string | undefined | The label announced on pick-up; defaults to the element’s text. |
Types 1
| Name | Type | Description |
|---|---|---|
Gestures | pointer · touch · keyboard | Pointer and touch run the shared drag-drop gesture (ghost preview, 300 ms touch hold, Escape cancels) with a live drop preview in the target; the keyboard / single-pointer twin: Enter, Space or a click picks the item up (aria-pressed, announced) and Enter or a click on any scheduler cell places it — Escape puts it down. |
Configuration
Properties 3
| Name | Type | Default | Description |
|---|---|---|---|
provideOgeSchedulerConfig(config) | Provider | — | Configures every scheduler below the provider; shallow merge per top-level key (a partial messages replaces whole nested blocks). |
messages | OgeSchedulerMessages | — | Every user-facing string, aria labels included: toolbar (labels, view names, date-navigator), popup, editor (titles, field labels, validation, the recurrence editor and its ICU summary templates), grid (aria templates with {token} placeholders, "+{count} more", week numbers, the "+N more" popup), announcements (live-region templates — plural ones such as copied / pasted are ICU messages rendered with ogeFormatMessage) and export (list-export headers). Keys added after 1.1 are optional — a catalog without them falls back to English. |
minAppointmentMinutes | number | 15 | Minimum rendered chip height in minutes — zero-length reminders stay clickable. |
Notes
- Dates are plain local
Dates throughout (Intl-only house rule — no date library, no adapter, no timezone database). RRULE stamps without a suffix are local wall time;…Zstamps are UTC and convert to the matching local instant. The supported RFC 5545 subset is FREQ DAILY/WEEKLY/MONTHLY/YEARLY, INTERVAL, COUNT ⊕ UNTIL, BYDAY, BYMONTHDAY, BYMONTH, BYHOUR, BYMINUTE, BYSETPOS and WKST, plusDTSTART/RDATE/EXDATElines when the rule field holds an iCalendar property block.TZID, BYYEARDAY, BYWEEKNO, BYSECOND and EXRULE reject the whole rule rather than truncating it. - No WAI-ARIA APG scheduler pattern exists. The widget composes the calendar-grid pattern: the view body is a
role="grid"whose first row holdsrole="columnheader"cells (the full date, plus the resource when grouped; weekday names in the month view), and one roving-tabindex cell (arrows, Home/End, Enter/Space creates) that is also thearia-selectedcell — selection follows focus, and a live drag-to-create range selects the slots it covers. A read-only scheduler setsaria-readonlyon the grid. The appointment chips form a second tab stop ofrole="button"elements — Left/Right cycles chronologically, Enter opens the popup, Delete deletes, and Ctrl+Arrow moves / Ctrl+Shift+Up/Down resizes as the keyboard equivalent of drag, announced through a polite live region. - Binding a plain array never mutates it — edits land in an internal working set and the past-tense events carry the data to persist. A
DataSourcewithinsert/update/removeis written through and reloaded instead.