Components / Date and time fields
Date and time fields
Explore every variant and expand each example’s formatted usage code.
Date and time fields
DateTimeField inputs and configurable date/time editor compositions.
Usage · TSX
<DateTimeField
aria-label="Date field"
value={fieldDate}
onValueChange={setFieldDate}
picker={{ text: { chooseDate: 'Choose field date' } }}
/>
<DateTimeField
aria-label="Date and time field"
kind="datetime"
value={fieldDateTime}
onValueChange={setFieldDateTime}
picker={{
timeFormat: '24h',
text: { chooseDate: 'Choose field date and time' },
}}
/>Live preview
Oct
2026
#MonTueWedThuFriSatSun
40
41
42
43
44
Selected value
Usage · TSX
<div class="catalog-temporal-demo">
<div class="catalog-temporal-layout">
<fieldset class="catalog-temporal-settings">
<legend>Configuration</legend>
<label>
<span>Value</span>
<Dropdown
className="rv-select"
source={[
{ value: 'date', label: 'Date' },
{ value: 'datetime', label: 'Date and time' },
{ value: 'time', label: 'Time' },
]}
value={kind}
onChange={(value) => {
const next = String(value) as typeof kind;
setKind(next);
setValue(null);
if (next !== 'date' && selection === 'multiple')
setSelection('single');
}}
config={{ ariaLabel: 'Value' }}
/>
</label>
<label>
<span>Selection</span>
<Dropdown
className="rv-select"
source={[
{ value: 'single', label: 'Single' },
{ value: 'range', label: 'Range' },
...(kind === 'date'
? [{ value: 'multiple', label: 'Multiple dates' }]
: []),
]}
value={selection}
onChange={(next) => {
setSelection(String(next) as typeof selection);
setValue(null);
}}
config={{ ariaLabel: 'Selection' }}
/>
</label>
<label>
<span>Months</span>
<Dropdown
className="rv-select"
source={[
{ value: '1', label: '1' },
{ value: '2', label: '2' },
{ value: '3', label: '3' },
]}
value={String(months)}
onChange={(next) => setMonths(Number(String(next)))}
config={{ ariaLabel: 'Months' }}
/>
</label>
<label>
<span>Caption</span>
<Dropdown
className="rv-select"
source={[
{ value: 'label', label: 'Label' },
{ value: 'dropdown', label: 'Month/year dropdowns' },
]}
value={caption}
onChange={(next) =>
setCaption(String(next) as typeof caption)
}
config={{ ariaLabel: 'Caption' }}
/>
</label>
<label class="catalog-temporal-check">
<Input
type="checkbox"
checked={weeks}
onChange={(event) => setWeeks(event.currentTarget.checked)}
/>{' '}
Week numbers
</label>
</fieldset>
<div class="catalog-temporal-preview">
<span class="catalog-temporal-caption">Live preview</span>
<TemporalPicker {...options} value={value} onChange={setValue} />
</div>
</div>
<div class="catalog-temporal-result">
<span>Selected value</span>
<output aria-label="Selected date/time value">
{value == null
? 'No date selected'
: typeof value === 'string'
? value
: Array.isArray(value)
? value.join(' · ') || 'No date selected'
: [value.from, value.to].filter(Boolean).join(' → ')}
</output>
</div>
</div>Oct 12–17Oct 12Oct 15+1
Usage · TSX
{renderTemporalValue(h, {
values: ['Oct 12–17'],
fullValue: 'Oct 12, 2026 – Oct 17, 2026',
})}
{renderTemporalValue(h, {
values: ['Oct 12', 'Oct 15', 'Oct 20'],
fullValue: 'Oct 12, 2026; Oct 15, 2026; Oct 20, 2026',
multiple: true,
})}Usage · TSX
<DateTimeField
value={date}
kind="datetime"
onValueChange={setDate}
picker={{
timeFormat: '24h',
calendar: { captionLayout: 'dropdown' },
}}
/>MonTueWedThuFriSatSun
Usage · TSX
<CalendarPicker
selected={timed}
onSelectionChange={setTimed}
defaultMonth="2026-10-01"
referenceDate={reference}
footer={
<div class="rv-form-grid">
<label class="rv-field">
<span class="rv-field__label">Start time</span>
<DateTimeField
kind="time"
value={start}
onValueChange={setStart}
picker={{
timeFormat: '24h',
text: { chooseTime: 'Choose start time' },
}}
/>
</label>
<label class="rv-field">
<span class="rv-field__label">End time</span>
<DateTimeField
kind="time"
value={end}
onValueChange={setEnd}
picker={{
timeFormat: '24h',
text: { chooseTime: 'Choose end time' },
}}
/>
</label>
</div>
}
/>API reference
Explore the complete contracts and inspect complex types.