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

22 lines
438 B
Markdown
Raw Normal View History

2015-05-27 20:41:16 +08:00
# 范围
2015-10-21 16:27:48 +08:00
- order: 6
2015-06-02 17:20:02 +08:00
2015-07-08 14:55:05 +08:00
设置 `disabledDate` 方法,来确定不可选时段。
2015-06-02 17:20:02 +08:00
2015-06-17 17:25:12 +08:00
如上例:不可选择今天之后的日期。
2015-05-27 20:41:16 +08:00
---
````jsx
2015-06-09 14:50:55 +08:00
var Datepicker = antd.Datepicker;
2015-05-29 15:06:45 +08:00
var disabledDate = function(current, value) {
// can not select days after today
return current.getTime() > Date.now();
};
2015-05-27 20:41:16 +08:00
2015-10-20 16:47:55 +08:00
ReactDOM.render(
2015-07-08 14:55:05 +08:00
<Datepicker disabledDate={disabledDate} />
2015-05-27 20:41:16 +08:00
, document.getElementById('components-datepicker-demo-range'));
````