A typed date field with a calendar to choose from, and a time when needed.
import { DatePicker } from '@oztix/roadie-components/date-picker'
Type a date, as in DateField, or press the calendar button and choose a day. Focus the empty field for hints at what can be typed, such as Tomorrow or In 2 weeks, and as you type, the first suggestion is highlighted so Enter takes it. The calendar opens on the chosen day, or on today, with focus on it. Choosing a day closes it and puts focus back on the button. The value is a plain ISO date such as '2026-11-27', or null.
granularity='minute' adds a TimeField beside the date. The value is then the instant the date and time name in timeZone, with its offset, such as '2026-11-27T19:30:00+11:00', and it stays null until both are filled in. Pass the venue's zone, so a Perth organiser setting doors for a Melbourne show sets them on Melbourne's clock. A time that daylight saving skips, such as 2:30am on the morning the clocks go forward, moves to where it lands, 3:30am, and the field shows it.
The calendar button shrinks with the field, so it always sits inside it.
readOnly shows the date and turns off the calendar button. disabled turns off both.
Wrap it in Field. The label points at the date input, and Field.ErrorText says why typed text isn't a date or a time. At minute granularity the date and time sit in a group named by the label.
disabled takes the same matchers as Calendar. Matched days are disabled in the calendar and refused when typed. Here Raffia Spaceship runs on Fridays and Saturdays in November.
captionLayout='dropdown' swaps the month name for month and year selects, for dates far from today. Most people will type a date of birth, but the selects help those who don't.
Do
Choose a start and an end with DateRangePicker, which keeps them in order and offers presets.
Don’t
Don't put two DatePickers side by side for a range. Nothing stops the end coming before the start.
<DatePickergranularity='minute'timeZone={venue.timeZone}/>
Do
Event times are read on the venue's clock. Say so in the label, such as "Doors, Melbourne time".
<DatePicker granularity='minute' />
Don’t
Don't lean on the browser's zone for an event time. An organiser in another state sets the wrong moment.
Do
Disable days that can't be chosen. They stay in the grid for keyboard users and are refused when typed.
Don’t
Don't check the date only after the form is sent. Say what's wrong as soon as it's chosen.
Field.Label or aria-label. The calendar button is named after the picker and its date, such as "Choose date, Fri 27 Nov 2026, Doors", and the popup "Choose date, Doors", so pickers side by side stay apart.Escape, a tap outside or a swipe down closes it.minute granularity the date and the time are a group named by the label, with inputs named "Date" and "Time".Page Up, Page Down, Home and End move as in Calendar. Enter or Space chooses the focused day and closes it. Escape closes it without a change. Either way focus goes back to the button, so on a phone the keyboard doesn't open.Enter still submits the form. Once you type, the first suggestion is highlighted and Enter takes it. The arrow keys move through the list, and Escape closes it and keeps the text. On a phone the list opens under the field, above the page.Enter commits typed text instead of submitting the form, and Escape puts back the last date.name, a hidden input submits the value, so a form never receives the formatted text. A disabled picker submits nothing.A typed date field with a calendar to choose from, and a time when needed.
An ISO date such as `'2026-11-27'` at `day` granularity. At `minute`, an ISO date-time; one with an offset is shown on the wall clock of `timeZone`. Pair with `onValueChange`.
The value to start from when uncontrolled.
Called with an ISO date at `day` granularity. At `minute`, with the instant the date and time name in `timeZone`, with its offset, such as `'2026-11-27T19:30:00+11:00'`, or null until both are known.
`minute` adds a time field beside the date.
Defaults to day.
IANA zone whose wall clock the date and time are read on, and whose calendar decides today. Pass the venue's zone for an event time. Defaults to the viewer's.
`true` turns the picker off. Matchers, as on `Calendar`, disable those days in the calendar and refuse them when typed. Inherits `true` from `Field`.
Marks the picker as invalid. Inherits from `Field` when omitted.
Inherits from `Field` when omitted.
Shows the value without letting it change.
Submits the value with a form under this name.
The id of a form outside the picker to submit the value with.
Defaults to md.
Defaults to 'normal'.
Hint in the empty date input, such as "14 Mar or next Fri".
A ref to the date input, for focusing it.
How the date reads when not being edited, from the datetime formatters.
Defaults to 'long'.
At `minute` granularity, `12` reads "7:30pm" and `24` reads "19:30".
Defaults to 12.
At `minute` granularity, minutes per step of the time field's arrow keys. A typed time off the step shows an error.
Defaults to 1.
Today as an ISO date. Defaults to today in `timeZone`.
First day of the week in the calendar: 1 is Monday and 7 is Sunday.
Defaults to 1.
Defaults to 'en-AU'.
`dropdown` swaps the calendar's month name for month and year selects.
Defaults to 'label'.
The earliest month the calendar reaches, as any ISO date in it.
The latest month the calendar reaches, as any ISO date in it.
Whether the calendar is open. Pair with `onOpenChange`.
Whether the calendar starts open when uncontrolled.
Defaults to false.
Called when the calendar opens or closes.