Date picker: an input-style trigger showing the formatted date (ranges included) and a calendar in a popover, with presets like “Today”, “Last 7 days”…, and an optional time row for date and time values; form-associated.
Initial ISO value (“2026-09-22” or “2026-09-01/2026-09-22”).
name
string
Form field name (ISO value).
placeholder
string
Pick a date
Text shown when nothing is selected.
format
short | medium | long | full
medium
Intl style of the displayed date (ranges via formatRange: “Sep 1-22, 2026”).
presets
boolean
Shows the default presets column (depends on the mode).
clearable
boolean
Button to clear the date.
required
boolean
Native validation; a range must be complete.
disabled
boolean
Disables the trigger.
invalid
boolean
Error style + aria-invalid.
placement
bottom-start | top-start…
bottom-start
Popover placement (flipped when there is no room).
min / max / disabled-dates / disable-weekends / months / locale / week-start / today
-
Forwarded as-is to <mv-calendar>. Locale: The value auto follows the page language (nearest lang); without the attribute, en-US unless the app registered the page language with setStrings() (core/i18n.js).
time
boolean
Date and time mode (single mode only): a time field and a Done button sit under the calendar and the value becomes “2026-10-02T14:30”, like datetime-local. Picking a day then moves to the time; Done, Enter in the time, Escape or a click outside closes.
Custom presets (shown even without the presets attribute). An optional key names the strings entry that gives the button text (the default presets use it).
calendar
MvCalendar
Inner calendar (isDateDisabled, goTo…).
isOpen
boolean
Whether the popover is open.
timePicker
MvTimePicker | null
Inner time field in time mode.
strings
Partial<Record<string, string | { one, other }>>
Overrides for the default text (en-US): clearDate (clear button label), presets (preset group label), placeholderDate, placeholderRange and placeholderMultiple (empty trigger text and dialog label), rangeOpen (range without an end, {start}), datesSelected (multiple mode, {n}, { one, other }), missingDate and missingRange (required messages), presetToday, presetTomorrow, presetInAWeek, presetInAMonth, presetLast7Days, presetLast30Days, presetThisMonth, presetLastMonth and presetThisYear (default preset buttons; a custom preset with a key reads its text here), and for the time attribute: time, done, placeholderDateTime, missingDateTime, missingTime. The inner calendar has its own strings (key "calendar"). App-wide translations: setStrings() from core/i18n.js, under the key "date-picker". Can be set before the element is defined.
Methods
Name
Description
open() / close({ focus })
Opens or closes the popover.
clear()
Clears the value.
checkValidity() / reportValidity()
Native validation.
Events
Name
Description
mv-change
detail: { value, date, start, end, complete, preset? }; in time mode also time (“14:30”), and date carries the time.
Time mode parts: calendar and time column, time row, its label and the Done button.
CSS variables
Name
Default
Description
--mv-date-picker-width
16rem (18rem for ranges)
Trigger width.
--mv-date-picker-radius
var(--mv-radius-md)
Trigger radius.
Accessibility
<button> trigger with aria-haspopup=dialog and aria-expanded, named by the <label for> + the displayed value. The popover is a labeled non-modal role=dialog; on open, focus moves to the calendar's active day (full APG grid), Escape or picking a date/range closes it and returns focus to the trigger; tabbing out also closes it. ↓ on the trigger opens it. Presets are aria-pressed buttons. In time mode the time field follows the calendar in the tab order (its segments are spinbuttons), then the Done button.