You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
448 B

# 范围
- order: 3
10 years ago
设置可选日期的范围,用 `disabled` 方法来定义不可选择时间。
比如不可选择今天之后的日期。
---
````jsx
var Datepicker = antd.Datepicker;
var disabledDate = function(current, value) {
// can not select days after today
return current.getTime() > Date.now();
};
React.render(
<Datepicker disabled={disabledDate} />
, document.getElementById('components-datepicker-demo-range'));
````