Merge pull request #2441 from Safelite/feature/CASH-464
CASH-464: trigger show another month if no available dates in 1st 2 rows
This commit is contained in:
commit
5ab742f950
2 changed files with 10 additions and 4 deletions
|
|
@ -684,6 +684,7 @@ export default {
|
||||||
return monthToAdd;
|
return monthToAdd;
|
||||||
},
|
},
|
||||||
async showAnotherMonth() {
|
async showAnotherMonth() {
|
||||||
|
if (!this.months) return;
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
let monthToShow;
|
let monthToShow;
|
||||||
let monthStartDateNum = 0;
|
let monthStartDateNum = 0;
|
||||||
|
|
|
||||||
|
|
@ -357,10 +357,15 @@ export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const selectableDatesData = this.selectableDatesData;
|
const selectableDatesData = this.selectableDatesData;
|
||||||
|
// if no date selected on load
|
||||||
// if no date selected on load, then use first available date
|
if (!this.selectedDate) {
|
||||||
if (!this.selectedDate && selectableDatesData?.days?.length > 0) {
|
if (selectableDatesData?.days?.length > 0) {
|
||||||
this.selectedDate = selectableDatesData.days[0].date;
|
this.selectedDate = selectableDatesData.days[0].date;
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.$refs.datePicker.showAnotherMonth();
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue