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

32 lines
717 B
Markdown
Raw Normal View History

2016-03-31 09:40:55 +08:00
---
order: 8
title:
2016-06-19 11:17:09 +08:00
zh-CN: 日期范围二
en-US: Date range, case 2
2016-03-31 09:40:55 +08:00
---
2015-06-02 17:20:02 +08:00
2016-06-19 11:17:09 +08:00
## zh-CN
使用 `RangePicker` 实现日期范围选择有更好的交互体验。
2015-05-27 20:41:16 +08:00
2016-06-19 11:17:09 +08:00
## en-US
By using `RangePicker` to specify a date range, you can achieve a better interactive experience.
2015-05-27 20:41:16 +08:00
````jsx
import { DatePicker } from 'antd';
const RangePicker = DatePicker.RangePicker;
function onChange(dates, dateStrings) {
console.log('From: ', dates[0], ', to: ', dates[1]);
console.log('From: ', dateStrings[0], ', to: ', dateStrings[1]);
}
ReactDOM.render(<div>
2016-09-29 12:20:21 +08:00
<RangePicker style={{ width: 200 }} onChange={onChange} />
<br />
<RangePicker showTime format="YYYY/MM/DD HH:mm:ss" onChange={onChange} />
</div>, mountNode);
2015-05-27 20:41:16 +08:00
````