Migrating from FullCalendar
Two tools, used together:
dz-migrate(@dzcalendar/migrate, a development tool) rewrites your code: imports, plugins,new Calendar(…), the common calls, Angular’s<full-calendar>. What needs a person is marked with a// dz-migrate:comment.@dzcalendar/compat-fullcalendartranslates a FullCalendar options object at run time: the application keeps its options and its callbacks.
The steps
Section titled “The steps”-
Install the tool and see what it would change:
Terminal window npm install -D @dzcalendar/migratenpx dz-migrate src -
Rewrite:
Terminal window npx dz-migrate src --write -
Swap the packages — every
@fullcalendar/*goes:Terminal window npm install @dzcalendar/core @dzcalendar/dom @dzcalendar/compat-fullcalendar @dzcalendar/themenpm uninstall @fullcalendar/core @fullcalendar/daygrid @fullcalendar/timegrid @fullcalendar/interaction -
Read the
problemsthe translation reports, and the// dz-migrate:comments left in the code.
What dz-migrate rewrites
Section titled “What dz-migrate rewrites”| Before | After |
|---|---|
import { Calendar } from '@fullcalendar/core' |
import { createFromFullCalendar } from '@dzcalendar/compat-fullcalendar' |
new Calendar(el, options) |
createFromFullCalendar(el, options).calendar |
calendar.render() |
removed: the calendar is drawn when made |
next(), prev(), today() |
navigate('next' | 'prev' | 'today') |
changeView(v) |
update({ view: v }) |
refetchEvents(), unselect(), destroy() |
refetch(), select(null), destroy() |
Types (CalendarOptions, EventClickArg, EventApi…) |
the same names from @dzcalendar/compat-fullcalendar |
Plugins daygrid, timegrid, interaction, icalendar, resource* |
removed: built in |
@fullcalendar/rrule |
import '@dzcalendar/core/recurrence' (the compat package brings it itself) |
@fullcalendar/list, multimonth |
import '@dzcalendar/dom/list', '@dzcalendar/dom/multimonth' |
@fullcalendar/timeline, resource-timeline |
import '@dzcalendar/pro' |
@fullcalendar/core/locales/ar (es, de) |
import '@dzcalendar/dom/locales/ar', and locale: 'ar' |
Angular FullCalendarModule |
DZ_CALENDAR, DzFullCalendar |
Angular <full-calendar [options]="o"> |
<dz-calendar [dzFullCalendar]="o"> |
Calendar as a type |
CalendarInstance from @dzcalendar/dom |
Marked for a person, because the call changes shape: select(start, end)
(here select({ start, end, allDay })), gotoDate(d)
(update({ date: Temporal.PlainDate.from(d) })), addEvent(e)
(run({ type: 'event.create', event })), getEventById, getEvents
(kernel.store.snapshot), setOption(k, v) (update({ … })), on / off
(use the callbacks), Angular’s getApi() (the CalendarController).
At run time
Section titled “At run time”import { createFromFullCalendar } from '@dzcalendar/compat-fullcalendar';import type { EventClickArg } from '@dzcalendar/compat-fullcalendar';import '@dzcalendar/theme/dzcalendar.css';
const { calendar, problems, detach } = createFromFullCalendar(element, { initialView: 'timeGridWeek', headerToolbar: { left: 'prev,next today', center: 'title', right: 'dayGridMonth,timeGridWeek' }, events: [{ title: 'Consultation', start: '2026-10-21T09:00:00' }], eventClick: (info: EventClickArg) => console.log(info.event.title),}, { timeZone: 'Europe/Paris' }); // the zone when the options name noneconsole.log(problems); // every guess, every option without an equivalentRead problems once: each guess (zone-guessed) and each option with no
equivalent (compat-unsupported) is listed there.
What changes on the way
Section titled “What changes on the way”- The time zone. FullCalendar’s options rarely name one (theirs is the
browser’s). Give yours as the third argument (
{ timeZone }); otherwise the browser’s is used, and reported. A time without a zone is read in the calendar’s zone — and reported as a guess. In Angular, the zone ofprovideDzCalendaris kept when the options name none. - Days count from Monday = 1 (ISO), not Sunday = 0.
- Colours become tones; the colour is kept in
extendedProps.color. - Callbacks receive plain objects (
event.startis aDatethere, for compatibility); a refused move is undone withrevert(). - The height is CSS:
--dz-height. - Every day’s events. FullCalendar shows them all unless
dayMaxEventssays otherwise; so does the translation (dayMaxLanes: null, the weeks grow). eventDrop,eventResize,eventChange,eventAdd,eventRemovefollow a person’s change (a gesture, the keyboard, the menu, the editor). Your owncalendar.run()is not reported: persist from where your code makes the change.- The header.
headerToolbaris kept (left/rightbecomestart/end;false, no header), withcustomButtons.prevYear/nextYearare reported and left out. - Formats.
titleFormat,dayHeaderFormat,slotLabelFormat,eventTimeFormatand the list formats keep theirIntloptions; their own keys (meridiem,omitZeroMinute…) and format functions are reported. Hours are the locale’s (“09:00” in French, “9:00 AM” in English). - Dragging in.
new Draggable(el, { itemSelector, eventData })comes from@dzcalendar/compat-fullcalendar;droppable,drop,eventReceive,eventLeavekeep their arguments. Natively, usemakeDraggablefrom@dzcalendar/dom/drag. - Render hooks.
<name>ClassNames,<name>Content,<name>DidMount,<name>WillUnmountkeep their names and arguments.