Skip to content

Forms

IDatePicker

A calendar in a popover. The model is an ISO YYYY-MM-DD string, never a Date.

The string carries no time zone, so the date stays the day that was picked wherever it is read. Format it on the way out with Intl, dayjs or anything else.

With nothing selected the model is null and the trigger shows placeholder.

Bounds

min and max are ISO strings too. Dates outside the window are rendered disabled rather than hidden, so the reader can see where the limit falls.

Formatting the trigger

format takes Intl.DateTimeFormatOptions and decides how the selected date reads on the button. The calendar itself is unaffected.

Locale and week start

locale drives the month names, the weekday initials and the trigger's text. weekStartsOn overrides the locale's own convention when you need to — 0 is Sunday.

Every visible string is a prop: todayLabel, clearLabel, previousLabel and nextLabel.

Clearable

clearable adds a clear action beside "Today" in the footer. It sets the model back to null.

Sizes

Invalid and disabled

Props

PropTypeDefaultDescription
size'sm' | 'md' | 'lg''md'Control scale
placeholderstring'Pick a date'Shown while nothing is selected
disabledbooleanTrigger cannot be opened
invalidbooleanRed border and ring; inherited from IFormField when unset
idstringId for the trigger; IFormField supplies one
minstringEarliest selectable date, ISO YYYY-MM-DD
maxstringLatest selectable date, ISO YYYY-MM-DD
localestringMonth names, weekday initials and trigger text
formatIntl.DateTimeFormatOptionsHow the selected date reads on the trigger
weekStartsOn060 is Sunday. Defaults to the locale's convention
clearablebooleanAdds a clear action to the footer
todayLabelstring'Today'Footer action label
clearLabelstring'Clear'Clear action label
previousLabelstring'Previous month'Accessible name for the back arrow
nextLabelstring'Next month'Accessible name for the forward arrow
unstyledbooleanDrop built-in classes
classstringApplied to the trigger, which carries the field chrome
ui{ trigger?, placeholder?, content?, header?, heading?, nav?, months?, grid?, headCell?, cell?, cellTrigger?, footer?, action? }Per-slot class overrides

Model

ts
const issuedOn = ref<string | null>(null)

For a span rather than a single day, use IDateRangePicker.