pickerOptions: {
onPick: ({ maxDate, minDate}) => {
this.minDate = minDate
},
disabledDate:
(time) => {
if (this.minDate) {
return time > new Date(this.minDate).getTime() + 24 * 3600 * 1000 * 29 || time < new Date(this.minDate).getTime() - 24 * 3600 * 1000 * 29 || time > new Date(new Date().toLocaleDateString()).getTime()
} else {
return time > new Date(new Date().toLocaleDateString()).getTime()
}
}
}
时间选择器改变后同事要触发的事件
changeEvent (val) {
this.pickerBeginDateBefore = {
disabledDate: (time) => {
if (this.minDate) {
return (
time > new Date(this.minDate.getTime() + 29 * 24 * 3600 * 1000) ||
time < new Date(this.minDate.getTime() - 29 * 24 * 3600 * 1000)
)
}
return time.getTime() > Date.now()
}
}
},