CASH-464: trigger show another month if no available dates in 1st 2 rows

This commit is contained in:
Adam Caouette 2025-04-23 15:17:40 -04:00
parent 30eff5f0b0
commit 0add6bd7ac
2 changed files with 10 additions and 4 deletions

View file

@ -684,6 +684,7 @@ export default {
return monthToAdd;
},
async showAnotherMonth() {
if (!this.months) return;
this.isLoading = true;
let monthToShow;
let monthStartDateNum = 0;

View file

@ -357,10 +357,15 @@ export default {
mounted() {
this.$nextTick(() => {
const selectableDatesData = this.selectableDatesData;
// if no date selected on load, then use first available date
if (!this.selectedDate && selectableDatesData?.days?.length > 0) {
this.selectedDate = selectableDatesData.days[0].date;
// if no date selected on load
if (!this.selectedDate) {
if (selectableDatesData?.days?.length > 0) {
this.selectedDate = selectableDatesData.days[0].date;
} else {
setTimeout(() => {
this.$refs.datePicker.showAnotherMonth();
}, 50);
}
}
});
},