Type Alias: DayPickerContext<T>
DayPickerContext<
T
>: {classNames
:ClassNames
;components
:CustomComponents
;dayPickerProps
:DayPickerProps
;formatters
:Formatters
;getModifiers
: (day
) =>Modifiers
;goToMonth
: (month
) =>void
;isSelected
: (date
) =>boolean
|undefined
;labels
:Labels
;months
:CalendarMonth
[];nextMonth
:Date
|undefined
;previousMonth
:Date
|undefined
;select
:SelectHandler
<T
> |undefined
;selected
:SelectedValue
<T
> |undefined
;styles
:Partial
<Styles
> |undefined
; }
Represents the context for the DayPicker component, providing various properties and methods to interact with the calendar.
Type Parameters​
Type Parameter | Description |
---|---|
T extends {mode : Mode ;required : boolean ; } | The type of the DayPicker props, which must optionally include mode and required properties. This type can be used to refine the type returned by the hook. |
Type declaration​
Name | Type | Description |
---|---|---|
classNames | ClassNames | The class names for the UI elements. |
components | CustomComponents | The components used internally by DayPicker. |
dayPickerProps | DayPickerProps | The props as passed to the DayPicker component. Since 9.3.0 |
formatters | Formatters | The formatters used to format the UI elements. |
getModifiers | (day ) => Modifiers | Returns the modifiers for the given day. |
goToMonth | (month ) => void | Navigate to the specified month. Will fire the onMonthChange callback. |
isSelected | (date ) => boolean | undefined | Whether the given date is selected. |
labels | Labels | The labels used in the user interface. |
months | CalendarMonth [] | The months displayed in the calendar. |
nextMonth | Date | undefined | The next month to display. |
previousMonth | Date | undefined | The previous month to display. |
select | SelectHandler <T > | undefined | Set a selection. |
selected | SelectedValue <T > | undefined | The selected date(s). |
styles | Partial <Styles > | undefined | The styles for the UI elements. |