snapMinutes
The step, in minutes, that drags, resizes, selections and context-menu moments snap to in a time grid.
| Type | number |
|---|---|
| Default | 15 |
Live update (update()) | Yes |
| Declared in | packages/dom/src/settings.ts |
What it does
Section titled “What it does”A dragged event lands on a multiple of this many minutes; a resize, a
selection, the keyboard’s arrows and “New event at 14:30” from the context
menu use the same step. It is independent of how the grid is drawn
(timeGrid.slotMinutes): a grid labelled every hour can still snap to five
minutes. Days in a month are whole days, whatever this says. A value that is
not whole minutes from 1 to 1440 throws a RangeError.
Example
Section titled “Example”import { createCalendar } from '@dzcalendar/dom';
createCalendar(element, { timeZone: 'Europe/Paris', editable: true, snapMinutes: 5 });import { Component } from '@angular/core';import { DZ_CALENDAR } from '@dzcalendar/angular';
@Component({ selector: 'app-agenda', imports: [DZ_CALENDAR], template: `<dz-calendar timeZone="Europe/Paris" [editable]="true" [options]="{ snapMinutes: 5 }" />`,})export class Agenda {}import { DzCalendar } from '@dzcalendar/react';
export function Agenda() { return <DzCalendar timeZone="Europe/Paris" editable snapMinutes={5} />;}<script setup lang="ts">import { DzCalendar } from '@dzcalendar/vue';</script>
<template> <DzCalendar time-zone="Europe/Paris" editable :options="{ snapMinutes: 5 }" /></template>In Angular and Vue it goes in options; in React it is a prop.
Live demo
Section titled “Live demo”Drag an event: it moves by five minutes.
See also
Section titled “See also”editable— moving and resizing.selectable— selecting.timeGrid— how the grid’s hours are drawn.