ant-design/components/date-picker/demo/formatter.md
Benjy Cui 4026221d45 deps: hello moment (#2887)
* 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
2016-09-09 13:55:21 +08:00

494 B

order title
1
zh-CN en-US
日期格式 Date format

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);