API and Development
Calendar from @prepared911/ui/calendar is the date grid. It wraps @daypicker/react and uses local Date values. A field that edits a date is DateInput, not this grid. The grid does not take a trigger or own a popover; the field does.
Modes are CalendarMode.Single, CalendarMode.Range, and CalendarMode.DaysAgo.
| Name | Type | Description |
|---|---|---|
mode | CalendarMode | Single, Range, or DaysAgo. |
value / onValueChange | local Date or a range | A range reports when both ends are picked, unless allowPartialRange is set. |
disabled | boolean or (date: Date) => boolean | Disable the grid or individual days. |
disableFuture | boolean | Block future dates. |
minDate / maxDate | Date | Bounds. |
minRangeDays / maxRangeDays | number | Range length limits. |
captionLayout | Dropdown or Label | Month and year selects, or a label. |
confirm | apply and reset labels plus handlers | Apply commits through onValueChange. Reset restores the committed value. |
locale / weekStartsOn | Day and weekday text. With no locale, the nearest locale provider is used. | |
previousMonthLabel / nextMonthLabel | LocalizedMessage | Accessible names for the month controls. |
DaysAgo still selects a number of days before today. There is no DatePickerMode enum.