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

19 lines
458 B
Markdown
Raw Normal View History

2015-05-27 20:41:16 +08:00
# 范围
- order: 3
2015-05-29 15:06:45 +08:00
- description: 设置可选日期的范围,用 disabled 方法来定义不可选择时间。比如不可选择今天之后的日期。
2015-05-27 20:41:16 +08:00
---
````jsx
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'));
````