2015-05-27 20:41:16 +08:00
|
|
|
# 范围
|
|
|
|
|
|
|
|
- order: 3
|
2015-06-02 17:20:02 +08:00
|
|
|
|
2015-06-17 17:25:12 +08:00
|
|
|
设置 `disabled` 方法,来确定不可选时段。
|
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
|
|
|
|
|
|
|
React.render(
|
2015-05-29 15:06:45 +08:00
|
|
|
<Datepicker disabled={disabledDate} />
|
2015-05-27 20:41:16 +08:00
|
|
|
, document.getElementById('components-datepicker-demo-range'));
|
|
|
|
````
|