mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-04 04:58:55 +08:00
4026221d45
* deps: upgrade TimePicker * deps: upgrade DatePicker * deps: upgrade Calendar * fix: moment should work with LocaleProvider * feat: update API of TimePicker * feat: update Calendar's APIs * feat: update DatePicker's APIs * doc: update demo * revert: add dateString and timeString and so on * feat: add Calendar[defaultValue] * feat: add defaultPickerValue * docs: update docs about date picker * feat: set moment locale to zh-cn automatically
712 B
712 B
order | title | ||||
---|---|---|---|---|---|
1 |
|
zh-CN
用 dateCellRender
和 monthCellRender
函数来自定义需要渲染的数据。
en-US
This component can be rendered by using dateCellRender
and monthCellRender
with the data you need.
import { Calendar } from 'antd';
import moment from 'moment';
function dateCellRender(value) {
return <div>自定义日数据 {value.date()}</div>;
}
function monthCellRender(value) {
return <div>自定义月数据 {value.month()}</div>;
}
ReactDOM.render(
<Calendar defaultValue={moment('2010-10-10', 'YYYY-MM-DD')}
dateCellRender={dateCellRender} monthCellRender={monthCellRender}
/>
, mountNode);