Skip to content
Source
Sign inSign up
TanStack/time

feat(react-time): useDatePicker #9

Closedbart-krakowski(GitHub profile, opens in a new tab)wants to merge 32 commits intov0 fromrefs/pull/9/headopened

Showing 9 changed files with 108 additions and 0 deletions (loading 7).

x
0 of 9 viewed, 9 left
108 additions and 0 deletionsdocs/framework/react/reference/useDatePicker.mdAdded
View file
@@ -0,0 +1,108 @@
+---
+title: Use Date Picker
+id: useDatePicker
+---
+​
+### `useDatePicker`
+​
+```tsx
+export const useDatePicker = ({
+ initialDate = null,
+ minDate,
+ maxDate,
+ onSelectDate,
+}: UseDatePickerProps)
+```
+​
+`useDatePicker` is a hook that provides functionality for managing date selection, including navigation between months and setting minimum and maximum selectable dates.
+​
+​
+#### Parameters
+- `initialDate` (optional): The initial date to display in the date picker. If not provided, the current date will be used.
+ - This optional parameter specifies the initial date selected in the date picker. It defaults to null.
+- `minDate` (optional): The minimum selectable date in the date picker. If not provided, there is no minimum date.
+ - This optional parameter specifies the minimum selectable date in the date picker.
+- `maxDate` (optional): The maximum selectable date in the date picker. If not provided, there is no maximum date.
+ - This optional parameter specifies the maximum selectable date in the date picker.
+- `onSelectDate` (optional): A callback function that is called when a date is selected.
+ - This optional parameter specifies a callback function that is called when a date is selected.
+- `reducer` (optional): A custom reducer function to manage the state of the date picker.
+ - This optional parameter specifies a custom reducer function to manage the state of the date picker.