Import

import-scheduler.ts
import { NuiScheduler, type NuiSchedulerEvent } from '@needless-ui/angular/scheduler';

NuiScheduler

Events in a month, a week, a day, an agenda or a timeline.

Selector
nui-scheduler
Exported as
nuiScheduler
NuiScheduler: Properties
NameTypeDefaultDescription
eventsInputNuiSchedulerEvent<T>[][]The events to show.
resourcesInputNuiSchedulerResource[][]Rooms, people or machines: rows of the timeline, and columns of the day and the week.
viewTwo-way'month' | 'week' | 'day' | 'agenda' | 'timeline''week'The view shown.
viewsInputNuiSchedulerView[]allThe views people can switch between. By default all of them, the timeline only with resources.
timelineSpanInput'day' | 'week' | 'month''day'What the timeline shows: a day by its slots, or a week or a month by its days.
dateTwo-wayNuiDatetodayThe day shown, and where the keyboard is.
slotMinutesInputnumber30Minutes per row of the time grid, or per column of a day’s timeline.
snapMinutesInputnumberslotMinutesThe step events move and resize by.
dayStart, dayEndInputnumber0, 24The hours the time grid shows, from and to.
scrollHourInputnumber8The hour the time grid opens at.
agendaDaysInputnumber30Days the agenda looks ahead.
businessHoursInputNuiSchedulerHours[]Working hours, such as { days: [1, 2, 3, 4, 5], start: '09:00', end: '17:00' }. Other time is shaded.
weekendsInputbooleantrueShows the weekend. Without it, every view leaves out the locale’s weekend.
weekNumbersInputbooleanfalseShows ISO week numbers in the month, and above the times.
editableInputbooleanfalseEvents can be moved and resized, by pointer and keyboard.
selectableInputbooleanfalseTime can be chosen on the grid, to create events.
allowInput(time) => booleanDecides whether a move, a resize or a choice of time can happen.
toolbarInputbooleantrueShows the toolbar. Without it, build your own.
firstDayInput1 … 7The first day of the week, 1 for Monday. By default, the locale’s.
headingLevelInputnumber2The title’s heading level; the agenda’s days are one deeper.
localeInputstringLOCALE_IDFormats days and times.
labelsInputPartial<NuiSchedulerLabels>Every text the scheduler shows or announces, to translate.
cornersInputNuiCornersThe shape of its corners: round, squircle, bevel, scoop, notch or square.
radiusInputNuiRadiusHow big its corners are: none, small, medium, large or full.
densityInputNuiDensityHow much room it takes: compact, regular or roomy.
eventClickOutputNuiSchedulerEvent<T>Emits an event clicked, or opened with Enter.
eventChangeOutput{ event, start, end, resource? }Emits an event’s new times after a move or a resize, and its resources when they changed.
slotSelectOutput{ start, end, allDay, resource? }Emits the time chosen on the grid, and its resource.
rangeChangeOutput{ start, end }Emits the first and last day shown when they change.
previous, next, goTodayMethod() => voidShow the previous or next page, or today, for a toolbar of your own.
titlePropertySignal<string>What’s shown, as the toolbar’s title says it.

Customization inputs you leave unset follow the nearest data-nui-* attribute. See the customization guide.

NuiSchedulerEvent

An event. A timed event’s end isn’t included; an all-day event’s end is its last day.

NuiSchedulerEvent: Properties
NameTypeDefaultDescription
id, titlePropertystringIts key, and what it shows.
start, endPropertyNuiDateTime | NuiDateDates and times, or dates for all-day events.
allDayPropertybooleanBy default, whether start has no time.
toneProperty'accent' | 'neutral' | 'success' | 'warning' | 'danger''accent'Its palette.
color, classPropertystringAny CSS color, which wins over its tone, and classes to style it with.
resourcePropertystring | string[]The resources it belongs to.
rrulePropertystringA repeat rule from RFC 5545, such as FREQ=WEEKLY;BYDAY=MO.
exdatePropertystring[]Starts of occurrences that don’t happen.
recurrenceIdPropertyNuiDateTime | NuiDateOn an occurrence the scheduler reports: the start its rule gave it.
editablePropertybooleanWhether it can be moved, whatever the scheduler says.
dataPropertyTAnything else to keep with it.

NuiSchedulerResource

A room, a person or a machine that events belong to.

NuiSchedulerResource: Properties
NameTypeDefaultDescription
id, titlePropertystringIts key, and the name it shows.
tone, colorPropertyNuiSchedulerTone, stringThe colors of its events, unless they have their own.
businessHoursPropertyNuiSchedulerHours[]When it’s available, instead of the scheduler’s working hours.
dataPropertyRAnything else to keep with it.

NuiSchedulerEventTemplate

Draws events. The context holds the event and its time as text.

Selector
ng-template[nuiSchedulerEvent]

NuiSchedulerResourceTemplate

Draws the heads of resources. The context holds the resource.

Selector
ng-template[nuiSchedulerResource]

Helpers

Functions for repeating events and iCalendar files.

Helpers: Properties
NameTypeDefaultDescription
nuiSchedulerOccurrencesMethod(event, first, last) => NuiSchedulerEvent[]An event as it shows on the days given: each occurrence of a repeating one.
nuiSchedulerRuleMethod(text: string) => NuiSchedulerRule | nullReads a repeat rule, or returns null.
nuiSchedulerToIcsMethod(events, options?) => stringWrites events as an iCalendar file.
nuiSchedulerFromIcsMethod(text, { timeZone? }) => NuiSchedulerEvent[]Reads the events of an iCalendar file, with their times in one time zone.