2015-12-25 01:21:03 +08:00
|
|
|
# 日期范围二
|
2015-05-27 20:41:16 +08:00
|
|
|
|
2015-12-25 01:21:03 +08:00
|
|
|
- order: 8
|
2015-06-02 17:20:02 +08:00
|
|
|
|
2015-12-25 01:21:03 +08:00
|
|
|
使用 `RangePicker` 实现日期范围选择有更好的交互体验。
|
2015-05-27 20:41:16 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
````jsx
|
2015-12-10 16:12:10 +08:00
|
|
|
import { DatePicker } from 'antd';
|
2015-12-25 01:21:03 +08:00
|
|
|
const RangePicker = DatePicker.RangePicker;
|
2015-10-28 20:55:49 +08:00
|
|
|
|
2015-12-25 01:21:03 +08:00
|
|
|
function onChange(value) {
|
|
|
|
console.log('From: ', value[0], ', to: ', value[1]);
|
|
|
|
}
|
|
|
|
ReactDOM.render(<div>
|
2016-01-27 16:44:50 +08:00
|
|
|
<RangePicker style={{ width: 184 }} onChange={onChange} />
|
2015-12-25 01:21:03 +08:00
|
|
|
<br />
|
2016-01-26 10:24:15 +08:00
|
|
|
<RangePicker showTime format="yyyy/MM/dd HH:mm:ss" onChange={onChange} />
|
2015-12-29 12:08:58 +08:00
|
|
|
</div>, mountNode);
|
2015-05-27 20:41:16 +08:00
|
|
|
````
|