Skip to content

kernel

A kernel made with createKernel — the calendar’s model without a screen — for this calendar to draw.

TypeCalendarKernel
Defaultnot set
Live update (update())No — at creation only
Declared inpackages/dom/src/calendar.ts

The kernel is the calendar without the DOM: its state (view, date, range, title), its store, its sources, its history, its commands. createCalendar makes one from the options; given one, it draws that one instead: the kernel’s options (zone, locale, events, sources, store, rules, history) are the ones it was made with, and those given to createCalendar are not read.

It serves code that works on the model first — a test, a server rendering the same model, two drawings of one kernel. To show the same events in two calendars, a shared store is usually enough.

It is read when the calendar is made, in plain JavaScript only: the Angular, React and Vue components make their own kernel (share a store instead).

import { createKernel, loadTemporal } from '@dzcalendar/core';
import { createCalendar } from '@dzcalendar/dom';
await loadTemporal();
const kernel = createKernel({ timeZone: 'Europe/Paris', locale: 'fr-FR', initialView: 'timeGridWeek' });
kernel.setEvents([{ id: 'a', title: 'Consultation', start: '2026-10-21T09:00[Europe/Paris]' }]);
// The model works without a screen; the calendar draws it.
console.log(kernel.getState().title);
createCalendar(element, { kernel });

The components make their own kernel: in Angular, React and Vue, reach it through the controller (instance.kernel) or share a store.

  • store — share the events only.
  • historyLimit — the kernel’s undo history.
  • events — loaded into the kernel.