Skip to content

DateTimePicker

A full date picker plus a full time picker side by side, with their own popups. Either half committing updates the combined hidden input to a"YYYY-MM-DDTHH:MM" value. No combined change event fires; the child ink:date:change andink:time:change events bubble naturally.

Example

Event start
<DateTimePicker
  id="event-start"
  label="Event start"
  name="event-start"
  month="2026-09"
  locale="en-GB"
/>

The locale is set so day names render in English (formatLong follows the runtime default locale otherwise). Pick a day, then an hour and a minute: the hidden input combines them ("2026-09-12T09:30"). Clearing either half empties the combined value. month pins the date half's calendar; omit it to open on the selected value, or on today.

Preselected value

Event start
<DateTimePicker
  id="event-start-set"
  label="Event start"
  name="event-start-set"
  value="2026-09-12T09:30"
  month="2026-09"
  locale="en-GB"
/>

A value in "YYYY-MM-DDTHH:MM" form splits into the date and time halves server-side. Anything else (missingT, an impossible date, a bad time) leaves both halves empty — the value is never half-filled. Each half keeps its own label ("Event start: date" / "Event start: time") and popup; the group label never renders a for attribute, so no wrapping Field is used.

Props

PropTypeDefaultDescription
idstring-Required. Names the group label/message ids; children get "{id}-date" / "{id}-time" (triggers themselves carry no id).
labelstring-Group label; children are labelled "{label}: date" and "{label}: time".
namestringidHidden-input form name; carries the combined "YYYY-MM-DDTHH:MM" value. Children render no hidden input of their own.
valuestring ("YYYY-MM-DDTHH:MM")-Initial combined value, split server-side; malformed values leave both halves empty.
minstring (ISO)-Earliest selectable date on the date half; earlier days render disabled.
maxstring (ISO)-Latest selectable date on the date half; later days render disabled.
monthstring ("YYYY-MM")-Initial calendar month for the date half; falls back to the value month, then today.
localestring-BCP 47 locale for day and month names; runtime default when omitted.
hintstring-Help text below the pair.
errorstring-Error message below the pair.
disabledbooleanfalseNon-interactive; neither trigger can open.
classstring-Style passthrough.

Accessibility