antd中的disabledDate不可选择时间的处理

handleData(time){
if(!time){
return false
}else{
// 大于当前日期不能选 time > moment()
// 小于当前日期不能选 time < moment().subtract(1, “days”)
// 只能选前7后7 time < moment().subtract(7, “days”) || time > moment().add(7, ‘d’)
return time < moment().subtract(7, “days”) || time > moment().add(7, ‘d’)
}
}
*

disabledDate = (current) => {
// Can not select days before today and today
//return current && current < moment().endOf(‘day’);!!!!!当天之前的不可选,包括当天
return current < moment().subtract(1, ‘day’) !!!!!当天之前的不可选,不包括当天
}

你可能感兴趣的:(antd中的disabledDate不可选择时间的处理)