Import
import { NuiScheduler, type NuiSchedulerEvent } from '@needless-ui/angular/scheduler';NuiScheduler
Events in a month, a week, a day, an agenda or a timeline.
| Name | Type | Default | Description |
|---|---|---|---|
eventsInput | NuiSchedulerEvent<T>[] | [] | The events to show. |
resourcesInput | NuiSchedulerResource[] | [] | 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. |
viewsInput | NuiSchedulerView[] | all | The 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-way | NuiDate | today | The day shown, and where the keyboard is. |
slotMinutesInput | number | 30 | Minutes per row of the time grid, or per column of a day’s timeline. |
snapMinutesInput | number | slotMinutes | The step events move and resize by. |
dayStart, dayEndInput | number | 0, 24 | The hours the time grid shows, from and to. |
scrollHourInput | number | 8 | The hour the time grid opens at. |
agendaDaysInput | number | 30 | Days the agenda looks ahead. |
businessHoursInput | NuiSchedulerHours[] | Working hours, such as { days: [1, 2, 3, 4, 5], start: '09:00', end: '17:00' }. Other time is shaded. | |
weekendsInput | boolean | true | Shows the weekend. Without it, every view leaves out the locale’s weekend. |
weekNumbersInput | boolean | false | Shows ISO week numbers in the month, and above the times. |
editableInput | boolean | false | Events can be moved and resized, by pointer and keyboard. |
selectableInput | boolean | false | Time can be chosen on the grid, to create events. |
allowInput | (time) => boolean | Decides whether a move, a resize or a choice of time can happen. | |
toolbarInput | boolean | true | Shows the toolbar. Without it, build your own. |
firstDayInput | 1 … 7 | The first day of the week, 1 for Monday. By default, the locale’s. | |
headingLevelInput | number | 2 | The title’s heading level; the agenda’s days are one deeper. |
localeInput | string | LOCALE_ID | Formats days and times. |
labelsInput | Partial<NuiSchedulerLabels> | Every text the scheduler shows or announces, to translate. | |
cornersInput | NuiCorners | The shape of its corners: round, squircle, bevel, scoop, notch or square. | |
radiusInput | NuiRadius | How big its corners are: none, small, medium, large or full. | |
densityInput | NuiDensity | How much room it takes: compact, regular or roomy. | |
eventClickOutput | NuiSchedulerEvent<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 | () => void | Show the previous or next page, or today, for a toolbar of your own. | |
titleProperty | Signal<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.
| Name | Type | Default | Description |
|---|---|---|---|
id, titleProperty | string | Its key, and what it shows. | |
start, endProperty | NuiDateTime | NuiDate | Dates and times, or dates for all-day events. | |
allDayProperty | boolean | By default, whether start has no time. | |
toneProperty | 'accent' | 'neutral' | 'success' | 'warning' | 'danger' | 'accent' | Its palette. |
color, classProperty | string | Any CSS color, which wins over its tone, and classes to style it with. | |
resourceProperty | string | string[] | The resources it belongs to. | |
rruleProperty | string | A repeat rule from RFC 5545, such as FREQ=WEEKLY;BYDAY=MO. | |
exdateProperty | string[] | Starts of occurrences that don’t happen. | |
recurrenceIdProperty | NuiDateTime | NuiDate | On an occurrence the scheduler reports: the start its rule gave it. | |
editableProperty | boolean | Whether it can be moved, whatever the scheduler says. | |
dataProperty | T | Anything else to keep with it. |
NuiSchedulerResource
A room, a person or a machine that events belong to.
| Name | Type | Default | Description |
|---|---|---|---|
id, titleProperty | string | Its key, and the name it shows. | |
tone, colorProperty | NuiSchedulerTone, string | The colors of its events, unless they have their own. | |
businessHoursProperty | NuiSchedulerHours[] | When it’s available, instead of the scheduler’s working hours. | |
dataProperty | R | Anything else to keep with it. |
NuiSchedulerEventTemplate
Draws events. The context holds the event and its time as text.
NuiSchedulerResourceTemplate
Draws the heads of resources. The context holds the resource.
Helpers
Functions for repeating events and iCalendar files.
| Name | Type | Default | Description |
|---|---|---|---|
nuiSchedulerOccurrencesMethod | (event, first, last) => NuiSchedulerEvent[] | An event as it shows on the days given: each occurrence of a repeating one. | |
nuiSchedulerRuleMethod | (text: string) => NuiSchedulerRule | null | Reads a repeat rule, or returns null. | |
nuiSchedulerToIcsMethod | (events, options?) => string | Writes events as an iCalendar file. | |
nuiSchedulerFromIcsMethod | (text, { timeZone? }) => NuiSchedulerEvent[] | Reads the events of an iCalendar file, with their times in one time zone. |