Skip to content

assumeZone

For an instant column whose data writes date and time with no offset.

Typestring
Defaultnot set
Live update (update())Yes — give the columns again (update({ columns }))
Declared inpackages/core/src/columns/defs.ts

An instant written '2026-03-02T09:30' could be any of 24 moments: the grid does not guess. Without assumeZone the cell is empty. With assumeZone: 'Europe/Paris' the column reads such text as Paris time; a text with an offset (Z, +02:00) or epoch milliseconds is read as it is.

The zone is an IANA name. An unknown one is refused with an unknown-zone error, and the column is left out. A wall time that a clock change skips or repeats is still read. The cells are shown in the grid’s timeZone, which may be another one.

import { createGrid } from '@dzgrid/dom';
import { EN } from '@dzgrid/dom/locales/en';
type Train = { id: string; line: string; leaves: string };
createGrid<Train>(document.getElementById('trains')!, {
rows: [{ id: 't1', line: 'Coast express', leaves: '2026-03-02T09:30' }],
columns: [
{ id: 'line', header: 'Line' },
{ id: 'leaves', header: 'Leaves', type: 'instant', assumeZone: 'Europe/Paris' },
],
getRowId: (r) => r.id,
messages: EN,
});