Skip to content

events

The events the calendar shows, given as an array of plain objects.

Typereadonly EventInput[]
Defaultnot set
Live update (update())Yes
Declared inpackages/core/src/kernel.ts

The array is loaded as one source, named "events". Each object describes an event; the fields used most:

Field Type
id string Keeps the event the same across updates (moves, undo)
title string
start string or Temporal value '2026-10-21T09:00[Europe/Paris]', or '2026-10-23' for a day
end string or Temporal value Or duration
duration { hours?, minutes?, days?… } Days are wall days, hours are elapsed hours
allDay boolean
timeZone string The event’s zone, for a start written without one
rrule string An RFC 5545 rule (FREQ=WEEKLY;BYDAY=MO): the event becomes a series
exdate, rdate arrays Dates taken out of, or added to, the series
tone string A colour by name: blue, green, red, amber, violet, slate, or yours
editable, startEditable, durationEditable boolean Per event, over the calendar’s editable
display string 'background' for a tint behind the other events (a closed day); 'marker' for a moment without length (an alert, a deployment): a line and a flag with its title, its start only
ongoing boolean still running: drawn from its start to now, growing each minute; its end or duration, the length expected; finished by event.update with ongoing: false (and its end, else now)
resourceId, resourceIds string, string[] The resources it belongs to
classNames, url, extendedProps Your classes, a link, your own data

Every event keeps its own zone. A start written 2026-10-22T10:00[America/Chicago] is 10:00 in Chicago, drawn at 17:00 in a calendar shown in Paris, and stays 10:00 in Chicago if the calendar’s zone changes. A start without a zone ('2026-10-21T09:00') is read in the calendar’s zone, and reported as a guess.

Updating. update({ events }) takes the whole new list. The store compares it with the previous one by id and by value: an array with the same events redraws nothing, a changed event redraws that event only. Give each event an id.

Bad data never throws. An event that cannot be read (no start, an unknown zone) is left out and reported: calendar.kernel.getProblems()?.problems lists { code, severity, path, detail } for the last load, with codes such as missing-start, unknown-zone, zone-defaulted.

import { createCalendar } from '@dzcalendar/dom';
import '@dzcalendar/core/recurrence'; // repeating events (rrule)
import type { EventInput } from '@dzcalendar/core';
const events: EventInput[] = [
{ id: 'a', title: 'Consultation', start: '2026-10-21T09:00[Europe/Paris]', duration: { minutes: 45 }, tone: 'green' },
{ id: 'b', title: 'Call Chicago', start: '2026-10-22T10:00[America/Chicago]', duration: { hours: 1 } },
{ id: 'c', title: 'Day off', start: '2026-10-23', allDay: true, tone: 'amber' },
{ id: 'w', title: 'Rounds', start: '2026-10-19T08:00[Europe/Paris]', duration: { hours: 2 }, rrule: 'FREQ=WEEKLY;BYDAY=MO,WE' },
];
const calendar = createCalendar(element, { timeZone: 'Europe/Paris', initialView: 'timeGridWeek', events });
// Later: the whole new list.
calendar.update({ events: [...events, { id: 'd', title: 'Training', start: '2026-10-24T10:00[Europe/Paris]', duration: { hours: 3 } }] });

The week of 19 October 2026 in Paris. The call is written in Chicago’s zone and drawn at 17:00; the rounds repeat every Monday and Wednesday; Sunday the 25th has 25 hours (the clocks go back), and the night shift crosses the repeated hour.