ant-design/components/date-picker/demo/time.md

19 lines
412 B
Markdown
Raw Normal View History

2016-03-31 09:40:55 +08:00
---
order: 4
title: 日期时间选择
---
2015-06-02 17:20:02 +08:00
2016-04-15 23:54:47 +08:00
增加选择时间功能,当 `showTime` 为一个对象时,其属性会传递给内建的 `TimePicker`
2015-05-29 21:07:46 +08:00
````jsx
import { DatePicker } from 'antd';
2015-05-29 21:07:46 +08:00
function onChange(value) {
2015-11-26 22:18:14 +08:00
console.log('选择了时间:', value);
}
ReactDOM.render(
<DatePicker showTime format="yyyy-MM-dd HH:mm:ss" placeholder="请选择时间" onChange={onChange} />
, mountNode);
2015-05-29 21:07:46 +08:00
````