mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-03 04:30:06 +08:00
docs: add missing info in Calendar, close: #5017
This commit is contained in:
parent
dded4bcde4
commit
ce0d4c39f2
@ -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}
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user