Date and time
DateTimePicker
·(UTC)
Value: 2026-03-12 21:30 UTC
·
Days in March 2026 only
·(UTC)
When to use
- You need user input for the publication/event date and time as two independent values.
- You need shared calendar-date constraints and a disabled state.
When not to use
- For a single day without a time, use
DatePicker. - For an arbitrary calendar layout, compose
CalendarandTimePickeryourself. - Do not treat the result as a ready-made UTC timestamp: the time zone and server-side conversion belong to the domain.
Minimal example
<DateTimePicker date={date} onDateChange={setDate} time={time} onTimeChange={setTime} />Public API
- The contract is
date,onDateChange,time,onTimeChange;minValue,maxValue(calendar, day bounds),disabled,hourCycle(12or24, as inTimePicker),localeandtimeZoneLabel(a time-zone label to the right of the time) are also supported. - The
minValueandmaxValuebounds are calendar bounds, that is, day bounds: calendar cells are dates without a time, and the comparison is by day.minValue={…T14:00}in the sense of "no earlier than an hour from now" will not work — the same day at nine in the morning passes. The component accepts no time bounds: "no earlier than an hour from now" depends on a time zone the kit does not know, and on the moment of submission, not rendering. This is a consumer rule. maskTime(value)is a public helper that coerces input to theHH:MMformat;normalizeTime(value, fallback)normalizes a valid time. These are helpers, not components.- Use strict date and time APIs; do not merge them into a
Dateat the UI boundary.
Accessibility and keyboard
- The child pickers keep their own accessible names and keyboard contracts.
- See
src/components/date-time/DateTimePicker.tsx,src/components/date-time/DateTimePicker.stories.tsx,tests/matrix.tsx.
TypeScript types
DateTimePickerProps
Prop
Type