The DatePicker component provides an interactive calendar interface for selecting dates and times. It supports various features like time selection, month navigation, and date range selection.
With timePicker, picking a day opens the time panel. Every change reaches onChange as it happens; the panel's Apply button confirms the date and time, calls onApply, and closes the dropdown the picker is in (a DateInput, or your own DropdownWrapper).
Pass locale, a BCP 47 tag such as "de" or "pt-BR", to show month and weekday names, and the time picker's time and AM/PM, in that language. The week starts on the locale's first day, Monday in "de". The names and the week start come from the browser's Intl API, so no locale data is bundled. Without locale they are in English and the week starts on Sunday.
The picker's own words come from labels: previousMonth, nextMonth, backToCalendar, apply, hours, minutes, am and pm are strings, and month and year are functions that name the month and year buttons from the value they show ("Month: March, change month" by default; keep the value in the name, as it is the button's text). Any label left out stays English, and am and pm default to the locale's words. DateInput, DateRangePicker and DateRangeInput take the same labels and pass them to their calendars.
- Keyboard navigation support for date selection
- Clear visual indicators for selected dates
- Proper ARIA attributes for screen readers
- The month and year buttons say what they do as well as what they show ("Month: March, change month"); labels translates them