resources
The resources events are booked on — a doctor, a room, a machine — drawn as columns by the resource views.
| Type | readonly ResourceInput[] |
|---|---|
| Default | not set |
Live update (update()) | Yes |
| Declared in | packages/core/src/kernel.ts |
What it does
Section titled “What it does”A resource is { id, title } and, optionally:
parentId: a tree (a department above its doctors);order: siblings by this number first.timeZoneandbusinessHours: its own hours, read in its own zone (a doctor in Riyadh on a calendar shown in Paris).eventConstraint,eventOverlap: its own rules, over the calendar’s.classNames,extendedProps, and any field of yours (to order or group by).
An event goes on a resource with resourceId (or several with
resourceIds). The resource views — resourceTimeGridDay,
resourceTimeGridWeek, resourceDayGridDay, resourceDayGridWeek,
resourceDayGridMonth, and the Pro’s resourceTimeline… — draw a column (a
row in the timeline) per resource; an event on two resources is in both. The
other views ignore resources.
Bad input never throws: what cannot be read goes to onResourceProblems.
update({ resources }) replaces the list; the same array again changes
nothing.
Example
Section titled “Example”import { createCalendar } from '@dzcalendar/dom';
const calendar = createCalendar(element, { timeZone: 'Europe/Paris', initialView: 'resourceTimeGridDay', resources: [ { id: 'benali', title: 'Dr Benali' }, { id: 'haddad', title: 'Dr Haddad', timeZone: 'Asia/Riyadh', businessHours: { daysOfWeek: [7, 1, 2, 3, 4], start: '08:00', end: '12:00' } }, ], events: [{ id: 'a', title: 'Visit', start: '2026-10-21T09:00[Europe/Paris]', resourceId: 'benali' }], onResourceProblems: (problems) => console.warn(problems),});
// Later: another list.calendar.update({ resources: [{ id: 'benali', title: 'Dr Benali' }] });import { Component } from '@angular/core';import type { ResourceInput } from '@dzcalendar/core';import { DZ_CALENDAR } from '@dzcalendar/angular';
@Component({ selector: 'app-agenda', imports: [DZ_CALENDAR], template: `<dz-calendar timeZone="Europe/Paris" view="resourceTimeGridDay" [resources]="doctors" />`,})export class Agenda { readonly doctors: ResourceInput[] = [{ id: 'benali', title: 'Dr Benali' }, { id: 'haddad', title: 'Dr Haddad' }];}import { DzCalendar } from '@dzcalendar/react';
const DOCTORS = [{ id: 'benali', title: 'Dr Benali' }, { id: 'haddad', title: 'Dr Haddad' }];
export function Agenda() { return <DzCalendar timeZone="Europe/Paris" defaultView="resourceTimeGridDay" resources={DOCTORS} />;}<script setup lang="ts">import { DzCalendar } from '@dzcalendar/vue';
const doctors = [{ id: 'benali', title: 'Dr Benali' }, { id: 'haddad', title: 'Dr Haddad' }];</script>
<template> <DzCalendar time-zone="Europe/Paris" view="resourceTimeGridDay" :resources="doctors" /></template>In the frameworks it is an input: Angular’s resources, React’s resources, Vue’s resources.
Live demo
Section titled “Live demo”One column per resource; the visit to assign is on none, so not shown here.
See also
Section titled “See also”resourceGroupField— a head over each group.showUnassigned— a column for events on no resource.- Resources & timeline.