Scheduler Options & Events

Options & events

The full constructor options, DOM events, and instance methods.

On this page

Options

new coreui.Scheduler(element, options)
OptionTypeDefaultDescription
agendaDaysnumber14Days shown (and stepped) by the agenda view.
businessHoursobject | nullnull{ daysOfWeek?, startHour, endHour, enforce? } — shades non-working time; enforce: true also rejects operations outside it.
dataSourceobject | nullnull{ getEvents(start, end), persistEvents? }remote data.
datestring | Date | nulltodayAnchor date of the visible range.
dayStartHournumber0First visible hour of the time grid.
dayEndHournumber24Hour the time grid ends at (exclusive).
eventsarray[]The events — see the event model.
eventOverlapbooleantruefalse rejects operations that would collide.
expandToFitbooleanfalseWiden events over adjacent free space.
firstDayOfWeeknumber1ISO weekday the week starts on.
hourHeightnumber48Pixels per hour in time-grid views.
labelsobject{}Overrides for the label set.
localestring | nullbrowserBCP 47 locale for date/time formatting.
monthMaxEventsPerDaynumber4Chips per month cell before “+N more”.
recurringEditScopestring'occurrence'Initial scope for recurring edits: 'occurrence', 'future' or 'all'.
resourceColumnWidthnumber160Column width when the resource view virtualizes.
resourcesarray[]{ id, label?, color? } — columns of the resource view.
selectablebooleantrueAllow range-select creation and click selection.
snapnumber15Drag/resize/create step in minutes.
timeZonestring | nullbrowserIANA zone all wall-clock math happens in.
timelineDaysnumber7Days covered by the timeline view.
timelineHourWidthnumber48Timeline horizontal zoom in pixels per hour.
viewstring'week''day', 'week', 'month', 'agenda', 'resource' or 'timeline'.

Events

All events are namespaced *.coreui.scheduler and fire on the scheduler element:

EventPayloadFires on
dateChangedateNavigation (prev/next/today, more-link jumps).
eventChangeaction, event, occurrence, revert, scopeCreate, move, resize, update, delete.
selectionChangeselectionClick selection changes.
viewChangeviewView switch.

Methods

MethodDescription
getEvents()Current events array (post-edits).
getSelection()Selected occurrence keys.
getVisibleRange()The visible window as { start, end } ISO strings.
navigate(direction)'prev', 'next' or 'today'.
setDate(date)Move the anchor date.
setEvents(events)Replace the events.
setView(view)Switch the view.
update(options)Merge new options and re-render.
dispose()Tear down listeners, timers and DOM.

Plus the standard CoreUI statics: Scheduler.getInstance(element) and Scheduler.getOrCreateInstance(element, options).