pickerOptions: {
// 选中日期后执行的回调
onPick({ maxDate, minDate }) {
this.maxDate = maxDate
this.minDate = minDate
const timeStamp = new Date().setHours(0, 0, 0, 0)
this.disabledDate = (time) => {
if (this.minDate) {
return time.getTime() > new Date(timeStamp - 1 * 86400000) || time.getTime() > new Date(this.minDate.getTime() + 3600 * 1000 * 24 * 30) || time.getTime() < new Date(this.minDate.getTime() - 3600 * 1000 * 24 * 30)
}
return time.getTime() > new Date(timeStamp - 1 * 86400000)
}
},
disabledDate(time) {
const timeStamp = new Date().setHours(0, 0, 0, 0)
return time.getTime() > new Date(timeStamp - 1 * 86400000)
}
},
// pickerOptions: {
// onPick: ({ maxDate, minDate }) => {
// this.orderTimeStr = minDate.getTime()
// if (maxDate) {
// this.orderTimeStr = null
// }
// },
// disabledDate: (time) => {
// if (this.orderTimeStr !== null) {
// const one = 30 * 24 * 3600 * 1000
// const minTime = this.orderTimeStr - one
// const maxTime = this.orderTimeStr + one
// return time.getTime() < minTime || time.getTime() > maxTime
// }
// }
// },