
屏幕快照 2018-09-13 14.41.46.png
antd官網(wǎng)雖然給了API和樣例用法,但是只有單一方向的限制,雙向限制試了很多次終于能用了
我寫的例子為具體某天之前與當天之后不可選
import { DatePicker } from 'antd';
const { RangePicker } = DatePicker;
disabledDate = (current) => {
return current < moment(new Date('2018/07/15')) || current > moment().endOf('day')
}
<RangePicker
disabledDate={this.disabledDate}
/>