Skip to content

Forms

IDateRangePicker

A two-month calendar for picking a span — a reporting period, a filter window, a stay. The model is a pair of ISO YYYY-MM-DD strings, like IDatePicker.

Both ends are null while nothing is chosen, and the first click sets start with end still null. Guard on period.end before querying with the range.

Months shown

Two months side by side is the default, since most ranges cross a month boundary. Drop to one where the popover has no room, or go to three for long ranges.

Bounds

Formatting and separator

format takes Intl.DateTimeFormatOptions and applies to both ends; separator is the text between them.

Locale and week start

clearLabel, previousLabel and nextLabel are props as well.

Clearable

Clearing sets both ends back to null.

Sizes

Invalid

Props

PropTypeDefaultDescription
size'sm' | 'md' | 'lg''md'Control scale
placeholderstring'Pick a date range'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 each end reads on the trigger
weekStartsOn060 is Sunday. Defaults to the locale's convention
monthsnumber2Months shown side by side
clearablebooleanAdds a clear action to the footer
separatorstring' – 'Text between the two dates on the trigger
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
interface DateRange {
  start: string | null
  end: string | null
}

The popover closes once both ends are set.