Business scenario
Business Code
startDate: {
disabledDate: (time) => {
let timeChange = false;
this.basicInfo.salesDateRange.forEach((item, index) => {
const time1 = (Date.parse(this.startDate) > time.getTime()) ||
(Date.parse(this.endDate) < time.getTime());
const time2 = (Date.parse(item.start) <= time.getTime()) &&
(Date.parse(item.end) > time.getTime());
// const time3 = Date.parse(this.basicInfo.endDate) < item.end;
// this.$logger.log(time3);
// this.index = index;
if (time1 || time2) {
timeChange = true;
}
});
return timeChange;
}
},
endDate: {
disabledDate: (time) => {
let timeChange = false;
this.basicInfo.salesDateRange.forEach((item, index, arr) => {
this.time1 = (Date.parse(this.startDate) > time.getTime()) ||
(Date.parse(this.endDate) < time.getTime());
this.time2 = (Date.parse(item.start) < time.getTime()) &&
(Date.parse(item.end) > time.getTime());
// this.timeList = [];
// if (item.end !== arr[index + 1].startDate) {
// time.timeList.push({ start: arr[index + 1].startDate, end: item.end });
// }
// const time3 = Date.parse(arr[this.index + 1].end) > Date.parse(this.basicInfo.salesDetail.startDate) &&
// Date.parse(item.start) < Date.parse(this.basicInfo.salesDetail.startDate);
});
if (this.time1 || this.time2) {
timeChange = true;
}
return timeChange;
}
}