2019-08-23 12:23:22 +00:00
|
|
|
# Calendar
|
|
|
|
|
2019-11-20 06:06:48 +00:00
|
|
|
Used to display custom calendar
|
2019-08-23 12:23:22 +00:00
|
|
|
|
2019-11-20 06:06:48 +00:00
|
|
|
### Usage
|
2019-08-23 12:23:22 +00:00
|
|
|
|
|
|
|
```js
|
2023-12-27 14:45:22 +00:00
|
|
|
import { Calendar } from "@docspace/shared/components";
|
2019-11-20 06:06:48 +00:00
|
|
|
```
|
2019-08-23 12:23:22 +00:00
|
|
|
|
2019-11-20 06:06:48 +00:00
|
|
|
```jsx
|
2019-09-18 07:52:55 +00:00
|
|
|
<Calendar
|
2020-10-16 13:16:01 +00:00
|
|
|
onChange={(date) => {
|
2019-09-11 10:46:21 +00:00
|
|
|
console.log("Selected date:", date);
|
|
|
|
}}
|
|
|
|
minDate={new Date("1970/01/01")}
|
|
|
|
maxDate={new Date("3000/01/01")}
|
|
|
|
locale="ru"
|
2019-11-20 06:06:48 +00:00
|
|
|
/>
|
2019-08-23 12:23:22 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
#### Properties
|
|
|
|
|
2023-07-14 15:09:54 +00:00
|
|
|
| Props | Type | Required | Values | Default | Description |
|
|
|
|
| ----------------- | :--------------: | :------: | :----: | :-----------------------: | ------------------------------------------ |
|
|
|
|
| `className` | `string` | - | - | - | Accepts class |
|
|
|
|
| `id` | `string` | - | - | - | Accepts id |
|
|
|
|
| `locale` | `string` | - | - | `User's browser settings` | Browser locale |
|
|
|
|
| `maxDate` | `date`, `string` | - | - | `new Date("3000/01/01")` | Maximum date that the user can select. |
|
|
|
|
| `minDate` | `date`, `string` | - | - | `new Date("1970/01/01")` | Minimum date that the user can select. |
|
|
|
|
| `onChange` | `func` | - | - | - | Function called when the user select a day |
|
|
|
|
| `style ` | `obj`, `arr` | - | - | - | Accepts css style |
|
|
|
|
| `initialDate` | `date` | - | - | `new Date()` | First shown date. |
|
|
|
|
| `selectedDate` | `date` | - | - | - | Selected date |
|
|
|
|
| `setSelectedDate` | `date` | - | - | - | Setter for selected date |
|