Skip to content

Datetime Editor

Double-click a value to edit. Adjust the calendar date and time together, then press Enter in a text field or click outside to save a valid draft. Date/time ranges keep both endpoints editable until saving. Escape discards the draft. Invalid drafts remain open; read-only cells cannot open or commit an editor.

Set dateEditor.autoApply: false to keep drafts until explicit Apply and show Apply/Cancel controls. Set dateEditor.showActions: true to show those controls while retaining automatic saves; showActions: false hides them. Clear remains available for optional values.

Source code
<template>
<p>
Double-click to edit. Valid changes save automatically; Escape discards the
draft.
</p>
<RevoGrid
:source="source"
:columns="columns"
:plugins="plugins"
:theme="isDark ? 'darkMaterial' : 'material'"
style="height: 340px"
/>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { currentThemeVue } from '../composables/useRandomData';
import RevoGrid from '@revolist/vue3-datagrid';
import { editorColumns, editorRows } from './editor-data';
const { isDark } = currentThemeVue();
const source = ref(editorRows());
const columns = editorColumns();
const plugins = [];
</script>

The editor uses TemporalPicker from @revolist/ui/date-time, combining the original shared CalendarPicker with TimeControl. Range mode uses the same controls for both endpoints and forwards the configured calendar options.

Use DateAndTimeEditor, or DateTimeEditor with dateEditor.kind: 'datetime'. New values store ISO timestamps; ranges store { from, to } and expose independent dates and times for both endpoints.

Set timeZone to the application’s IANA zone. precision, timeFormat, timeStep, minTime and maxTime configure time entry; calendar forwards the shared calendar options. Nonexistent local times are rejected. An unchanged instant preserves its original fold and precision; newly entered repeated times use the shared earlier-instant rule. Existing Date, spreadsheet-date number and string formats remain preserved by adapters.

Gantt’s separate Start/Finish fields, inline date editors, Scheduler event/dispatch dialogs, Kanban date fields and calendar exceptions use the same control. Product adapters retain their scheduling commands and timezone policies.

Localize dateEditor.text, partial dateEditor.actions and dateEditor.calendar.translations for popup, time and calendar controls. Set the IANA timezone on dateEditor.timeZone or dateEditor.calendar.timeZone; the editor setting takes precedence for both display and commit. Date/time labels do not change stored timestamp precision.