docs: add missing info in Calendar, close: #5017

This commit is contained in:
Benjy Cui 2017-02-23 15:57:05 +08:00
parent dded4bcde4
commit ce0d4c39f2
2 changed files with 18 additions and 2 deletions

View File

@ -13,7 +13,15 @@ When data is in the form of date, such as schedule, timetable, prices calendar,
## API
```html
**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');
<Calendar
dateCellRender={dateCellRender}
monthCellRender={monthCellRender}

View File

@ -15,7 +15,15 @@ title: Calendar
## API
```html
**注意:**Calendar 部分 locale 是从 value 中读取,所以请先正确设置 moment 的 locale。
```jsx
import moment from 'moment';
// 推荐在入口文件全局设置 locale
import 'moment/locale/zh-cn';
moment.locale('zh-cn');
<Calendar
dateCellRender={dateCellRender}
monthCellRender={monthCellRender}