You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This value will be used to generate the date cells at beginning. Its default value is `newDate()`.
74
-
75
-
#### `selectType`
76
-
77
-
The selection type of the calendar, currently support `'single'|'multiple'`. Its default value is `'single'`.
78
-
79
-
> This option must be set if you don't want to use `single` type.
80
-
81
-
#### `value`
82
-
83
-
Set it up to get the full control of the calendar. For `'single'` selection type, the type of this value should be `Date`. For `'multiple'` selection type, the type of this value should be `Date[]`.
84
-
85
-
#### `onChange`
86
-
87
-
```ts
88
-
typeOnChange: (value:Date|Date[]) =>void
89
-
```
90
-
91
-
For `single` selection type, the `value` is a `Date` instance. For `multiple` selection type, the `value` is an array of `Date` instances.
92
-
93
-
### Returns
94
-
95
-
#### `selectedDates`
96
-
97
-
An array contains the `Date` instances of all selected date.
98
-
99
-
#### `displayedYear`
100
-
101
-
The year of the calendar which should be rendered.
102
-
103
-
#### `displayedMonth`
104
-
105
-
The month of the calendar which should be rendered.
106
-
107
-
#### `changeDisplayedYear`
108
-
109
-
Call this function to add a value to `displayedYear`.
110
-
111
-
#### `changeDisplayedMonth`
112
-
113
-
Call this function to add a value to `displayedMonth`.
This value is used for displaying the current year and month. Default value is `new Date()`.
34
+
35
+
## `selectTyps`
36
+
37
+
The selecting type of the calendar component. These option will change the accepted `value` and the argument of `onChange`. Default value is `'single'`.
38
+
39
+
## `value`
40
+
41
+
For single mode, this option should be an instance of `Date`. For multiple mode, this options should be an array of `Date` instance. It can be useful when you want your calendar component be a controlled component.
42
+
43
+
## `onChange`
44
+
45
+
This function will be called when a date is selected by the `selectedThisDate` function which is generated for every date cell.
46
+
47
+
## `excludedDates`
48
+
49
+
If the date cell satisify the condition specified by this options, then the `isExcluded` flag will be set to `true`.
50
+
51
+
### `min`
52
+
53
+
Every date smaller than this value will be excluded.
54
+
55
+
### `max`
56
+
57
+
Every date larger than or equal to this value will be excluded.
58
+
59
+
### `arbitrary`
60
+
61
+
The date specified in this array will be excluded.
Add `displayedYear` by a value. For example, if `displayedYear` is `2022`, then `changeDisplayedYear(1)` will change `displayedYear` to `2023`.
47
+
48
+
If `options.override` is set to `true`, then `displayedYear` will be set to `1`.
49
+
50
+
## `changeDisplayedMonth`
51
+
52
+
Like `changeDisplayYear`, but change `displayedMonth` instead.
53
+
54
+
## `getDateCellInfos`
55
+
56
+
Use this function to get the calendar of the specified `year` and `month`. The default value of `year` and `month` is `displayedYear` and `displayedMonth`.
This value will be used to generate the date cells at beginning. Its default value is `new Date()`.
50
-
51
-
#### `selectType`
52
-
53
-
The selection type of the calendar, currently support `'single' | 'multiple'`. Its default value is `'single'`.
54
-
55
-
> This option must be set if you don't want to use `single` type.
56
-
57
-
#### `value`
58
-
59
-
Set it up to get the full control of the calendar. For `'single'` selection type, the type of this value should be `Date`. For `'multiple'` selection type, the type of this value should be `Date[]`.
60
-
61
-
#### `onChange`
62
-
63
-
```ts
64
-
typeOnChange: (value: Date|Date[]) => void
65
-
```
66
-
67
-
For `single` selection type, the `value` is a `Date` instance. For `multiple` selection type, the `value` is an array of `Date` instances.
68
-
69
-
### Returns
70
-
71
-
#### `selectedDates`
72
-
73
-
An array contains the `Date` instances of all selected date.
74
-
75
-
#### `displayedYear`
76
-
77
-
The year of the calendar which should be rendered.
78
-
79
-
#### `displayedMonth`
80
-
81
-
The month of the calendar which should be rendered.
82
-
83
-
#### `changeDisplayedYear`
84
-
85
-
Call this function to add a value to `displayedYear`.
86
-
87
-
#### `changeDisplayedMonth`
88
-
89
-
Call this function to add a value to `displayedMonth`.
0 commit comments