mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 19:50:05 +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
494 B
494 B
order | title | ||||
---|---|---|---|---|---|
1 |
|
zh-CN
使用 format
属性,可以自定义你需要的日期显示格式,如 YYYY/MM/DD
。
en-US
By using format
, you can customize the format(such as YYYY/MM/DD
) the date is displayed in.
import { DatePicker } from 'antd';
import moment from 'moment';
const format = 'YYYY/MM/DD';
ReactDOM.render(
<DatePicker defaultValue={moment('2015/01/01', format)} format={format} />
, mountNode);