2016-05-22 11:03:07 +08:00
---
category: Components
2016-11-09 14:43:32 +08:00
type: Data Display
2016-05-22 11:03:07 +08:00
cols: 1
title: Calendar
---
2016-11-29 17:13:24 +08:00
Container for displaying data in calendar form.
2016-05-22 11:03:07 +08:00
2016-09-10 13:43:30 +08:00
## When To Use
2016-05-22 11:03:07 +08:00
When data is in the form of date, such as schedule, timetable, prices calendar, Lunar calendar. This component also supports Year/Month switch.
## API
2017-02-23 15:57:05 +08:00
**Note:** Part of locale of Calendar is read from value. So, please set the locale of moment correctly.
```jsx
import moment from 'moment';
// It's recommended to set locale in entry file globaly.
import 'moment/locale/zh-cn';
moment.locale('zh-cn');
2016-05-22 11:03:07 +08:00
< Calendar
dateCellRender={dateCellRender}
monthCellRender={monthCellRender}
onPanelChange={onPanelChange}
2017-03-03 15:26:23 +08:00
onSelect={onSelect}
2016-05-22 11:03:07 +08:00
/>
```
| Property | Description | Type | Default |
|--------------|----------------|----------|--------------|
2016-09-09 13:55:21 +08:00
| value | set date | [moment ](http://momentjs.com/ ) | current date |
| defaultValue | set default date | [moment ](http://momentjs.com/ ) | default date |
2016-05-22 11:03:07 +08:00
| mode | can be set to month or year | string | month |
2016-09-09 13:55:21 +08:00
| fullscreen | to set whether full-screen display | boolean | true |
2017-03-02 13:35:07 +08:00
| dateCellRender | to set the way of renderer the date cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - |
| monthCellRender | to set the way of renderer the month cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - |
| dateFullCellRender | to set the way of renderer the date cell,the returned content will override the cell | function(date: moment): ReactNode | - |
| monthFullCellRender | to set the way of renderer the month cell,the returned content will override the cell | function(date: moment): ReactNode | - |
2017-01-20 20:10:50 +08:00
| locale | set locale | object | [default ](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json ) |
2017-03-03 15:26:23 +08:00
| onPanelChange| callback when panel change | function(date: moment, mode: string) | - |
| onSelect | callback when select date | function(date: moment) | - |
2017-05-23 17:07:17 +08:00
| disabledDate | specify the date that cannot be selected | (currentDate: moment) => boolean | 无 |