美文网首页
105、antd中的disabledDate不可选择时间的处理

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

作者: world_7735 | 来源:发表于2019-11-07 17:07 被阅读0次
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’) !!!!!当天之前的不可选,不包括当天
}

相关文章

网友评论

      本文标题:105、antd中的disabledDate不可选择时间的处理

      本文链接:https://www.haomeiwen.com/subject/vgvvbctx.html