Skip to content

Date range columns

Use a date range when each date needs its own column, such as a daily schedule. The example expands one definition into three date columns.

import { DateRangeColumnsPlugin } from '@revolist/revogrid-pro';
grid.plugins = [DateRangeColumnsPlugin];
grid.columns = [
{ prop: 'name', name: 'Task', size: 150 },
{
prop: 'day',
size: 92,
dateRangeColumns: { start: '2026-01-01', end: '2026-01-03', unit: 'day' },
cellTemplate: (h, { model, column }) =>
h('span', {}, model.days[column.dateSlot!.date] ?? '–'),
},
];
grid.source = [{ name: 'Design', days: { '2026-01-01': 'Plan' } }];

Start and end are inclusive civil dates. Day, week and month intervals use UTC. Generated properties default to day:YYYY-MM-DD; supply prop(slot, placeholder) for another stable, unique key. The immutable column.dateSlot is available to templates, and column(slot) can override properties once per generated column. Assign a new grid.columns array to update the range. Grouping, pinning and virtualization apply to generated columns. Ranges are limited to 10,000 slots.

Use createTimeRangeSlotHeaderFormatter or formatTimeRangeSlotHeaders for localized headings. Combine with HeatmapPlugin to color generated cells without replacing their templates.