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:
AdamCaouetteSafelite 2025-04-24 09:52:00 -04:00 committed by GitHub
commit 5ab742f950
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 4 deletions

View file

@ -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;

View file

@ -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);
}
} }
}); });
}, },