Skip to content
OGE logoOGE

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-scheduler

Properties 48

Data

Name Type DefaultDescription
dataSourcereadonly T[] | DataSource<T> | OgeSchedulerDataSource<T> | nullnullAppointment 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).
remoteFilteringbooleanfalseLoads 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.
keyExprstring | ((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 / disabledExprstring | ((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 / recurrenceExceptionExprstring | ((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.
reminderExprstring | ((item: T) => unknown)'reminder'Minutes before the start a reminder fires (see reminderTriggered) — OGE extra (Outlook parity).
startTimeZoneExpr / endTimeZoneExprstring | ((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.
resourcesreadonly OgeSchedulerResource[][]Resource kinds ({ fieldExpr, items, label?, useColorAsDefault? }): editor select fields, default appointment colors and timeline rows.
groupsreadonly 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' | undefinedundefinedHow 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.
groupByDatebooleantrueHorizontal 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).
disabledSlotsOgeSchedulerDisabledSlots | nullnullNon-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 DefaultDescription
currentDateDatenew Date()Anchor date of the visible period. Two-way ([(currentDate)]); writes clamp into [min, max].
timeZonestring | undefinedundefinedThe 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.
showTimeZoneEditorbooleanfalseAdds 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).
viewsreadonly (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.
showWeekNumbersbooleanfalseWeek 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.
virtualScrollingboolean | '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.
adaptiveViewboolean | { breakpoint?: number; view?: OgeSchedulerView }falseSwitches 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 / maxDate | undefined—Navigable date bounds: navigation buttons disable at the edges and every date write clamps.
firstDayOfWeeknumber | undefined—First day of week (0 = Sunday); undefined resolves from the locale via Intl.Locale.weekInfo.
weekendDaysreadonly 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.
hiddenWeekDaysreadonly number[] | undefined—Weekdays removed from the week views; the workWeek view always drops the weekend on top.
dayStartHour / dayEndHour / cellDurationnumber0 / 24 / 30Visible hour window and slot raster (minutes) of the time grids.
agendaDurationnumber7Days the agenda view lists from the anchor date.
scrollTimenumber | undefined—Initial scroll position of the day/week body in hours (fractions allowed, e.g. 8.5); re-applied on view/period changes.
rtlEnabledboolean | undefinedundefinedRight-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 DefaultDescription
allowAdding / allowUpdating / allowDeleting / allowDragging / allowResizingbooleantruePer-capability editing gates.
readOnlybooleanfalseDisplay-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).
snapDurationnumber | undefined—Drag/resize snap raster in minutes; defaults to cellDuration.
workHoursOgeSchedulerWorkHours | nullnullWorking-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).
snapToWorkHoursbooleanfalseClamps timed moves, drag-to-create ranges and drops into the target’s working hours (keeping the length when it fits).
allowOverlapbooleantruefalse 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.
selectedAppointmentsreadonly 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.
undoLimitnumber50Undo 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.
showAddButtonbooleantrueShows the toolbar "new appointment" button (Outlook parity) — creation without double-click; hidden while readOnly or allowAdding=false.
showAllDayPanelbooleantrueShows the all-day strip in the day/week views.
showCurrentTimeIndicatorbooleantrueThe accent now-line in today's column.
shadeUntilCurrentTimebooleanfalseDims today's column above the now-line.
maxAppointmentsPerCellnumber | 'auto''auto'Month-view lane budget per cell; the overflow folds into a "+N more" button (see moreMode).
localestring | undefined—BCP 47 locale for every Intl format; defaults to the browser locale.
messagesPartial<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)voidInserts programmatically through the same cancelable appointmentAdding pipeline as interactive creation.
updateAppointment(appointmentData, patch)voidApplies a patch through the guarded update pipeline.
deleteAppointment(appointmentData)voidDeletes through the guarded delete pipeline.
showAppointmentPopup(appointmentData?, createNew?)voidOpens the editing form — prefilled create form with createNew/no data, edit form otherwise (dx parity: the method opens the form).
hideAppointmentPopup()voidCloses the editor dialog and the summary popup.
scrollToTime(hours, minutes?)voidScrolls the day/week body to the given time of day.
scrollTo(date)voidNavigates to date and scrolls to its time of day.
getStartViewDate() / getEndViewDate()DateFirst 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> | nullThe bound data source, as given.
reload()voidReloads the data source: a load-once DataSource loads again, a range source drops its cache and reloads the visible range.
focus()voidFocuses the active view's grid (roving cell).
goToday() / navigate(direction)voidToolbar equivalents: jump to today / step one period (respects min/max).
copyAppointments(appointment?) / pasteAppointments(target)numberThe 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()voidEmpties selectedAppointments.
undo() / redo()booleanReverts / re-applies the last scheduler edit (the Ctrl+Z / Ctrl+Y keys); false when there is none.
canUndo() / canRedo()booleanWhether 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-icalNo 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-pdfLazy 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-excelLazy 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 / appointmentDeletingOgeSchedulerAppointment*ingEvent<T>Cancelable pre-events — set cancel = true to veto before the store changes.
appointmentAdded / appointmentUpdated / appointmentDeletedOgeSchedulerAppointment*edEvent<T>Fired only for applied changes — persist from these when binding plain arrays.
editorShowingOgeSchedulerEditorShowingEvent<T>Cancelable, before the editor opens; replace formItems to customize the form (dx onAppointmentFormOpening parity).

Reminders

Name Type Description
reminderTriggeredOgeSchedulerReminderEvent<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 / appointmentDblClickOgeSchedulerAppointmentClickEvent<T>Chip clicks; single click also opens the popup, double click the editor.
cellClick / cellDblClickOgeSchedulerCellClickEventEmpty-cell clicks; double click also opens the prefilled create editor.
appointmentContextMenu / cellContextMenuOgeSchedulerAppointmentClickEvent<T> / OgeSchedulerCellClickEventRight-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.
rangeSelectedOgeSchedulerRangeSelectedEventA drag-to-create cell-range selection landed; the prefilled create editor opens next.
appointmentDroppedOgeSchedulerAppointmentDroppedEvent<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.
dragOutOgeSchedulerDragOutEvent<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 / selectedAppointmentsChangeDate / OgeSchedulerView / readonly T[]The two-way model outputs.

Types 14

Name Type Description
OgeSchedulerAppointment<T>interfaceThe normalized appointment: key, source (the original item), text, startDate/endDate, allDay, color, description, recurrence fields and disabled.
OgeSchedulerViewOptionsinterfacePer-view overrides: type, name, dayStartHour, dayEndHour, cellDuration, intervalCount, groupOrientation.
OgeSchedulerWorkHoursinterface{ start, end, days? } — the emphasized working hours.
OgeSchedulerResourceIteminterface{ id, text, color?, workHours?, workDays? } — one assignable resource; its own working hours shade its grouped columns / rows.
OgeSchedulerDisabledSlots / OgeSchedulerBlockedRangetype / interfaceA 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>interfaceThe drag-in / drag-out payloads (see the events).
OgeSchedulerDataSource<T> / OgeSchedulerLoadOptionsinterface{ 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 / ogeFromWallClockfunction (@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.
OgeResourceHeaderTemplatestructural 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 directiveReplaces the chip content; context { $implicit: OgeSchedulerAppointment<T>, view }.
OgeSchedulerCellTemplatestructural directive [ogeCellTemplate]OGE extra — custom empty-cell content; context { $implicit: Date, view, allDay }.
OgeDateHeaderTemplatestructural directive [ogeDateHeaderTemplate]OGE extra — custom date-header content; context { $implicit: Date, view }.

OgeSchedulerDraggable

[ogeSchedulerDraggable]

Properties 3

Name Type Description
ogeSchedulerDraggableunknownThe 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.
ogeSchedulerDraggableDurationnumber | undefinedAppointment length in minutes; omitted = the target’s cell duration (whole days on day-scale targets).
ogeSchedulerDraggableTextstring | undefinedThe label announced on pick-up; defaults to the element’s text.

Types 1

Name Type Description
Gesturespointer · touch · keyboardPointer 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 DefaultDescription
provideOgeSchedulerConfig(config)Provider—Configures every scheduler below the provider; shallow merge per top-level key (a partial messages replaces whole nested blocks).
messagesOgeSchedulerMessages—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.
minAppointmentMinutesnumber15Minimum 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; …Z stamps 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, plus DTSTART/RDATE/EXDATE lines 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 holds role="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 the aria-selected cell — selection follows focus, and a live drag-to-create range selects the slots it covers. A read-only scheduler sets aria-readonly on the grid. The appointment chips form a second tab stop of role="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 DataSource with insert/update/ remove is written through and reloaded instead.