mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-13 07:39:10 +08:00
22 lines
427 B
Markdown
22 lines
427 B
Markdown
# 范围
|
|
|
|
- order: 3
|
|
|
|
设置 `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'));
|
|
````
|