ant-design/components/datepicker/demo/formatter.md

16 lines
324 B
Markdown
Raw Normal View History

2015-05-25 17:20:49 +08:00
# 日期格式
2015-05-27 20:41:16 +08:00
- order: 1
2015-06-02 17:20:02 +08:00
2015-06-17 17:25:12 +08:00
使用 `format` 属性,可以自定义你需要的日期显示格式,如 `yyyy/MM/dd`
2015-05-25 17:20:49 +08:00
---
````jsx
import { Datepicker } from 'antd';
2015-05-25 17:20:49 +08:00
2015-10-20 16:47:55 +08:00
ReactDOM.render(
2015-10-22 17:16:02 +08:00
<Datepicker defaultValue="2015/01/01" format="yyyy/MM/dd" />
2015-05-25 17:20:49 +08:00
, document.getElementById('components-datepicker-demo-formatter'));
````