CASH-464: trigger show another month if no available dates in 1st 2 rows
This commit is contained in:
parent
30eff5f0b0
commit
0add6bd7ac
2 changed files with 10 additions and 4 deletions
|
|
@ -684,6 +684,7 @@ export default {
|
|||
return monthToAdd;
|
||||
},
|
||||
async showAnotherMonth() {
|
||||
if (!this.months) return;
|
||||
this.isLoading = true;
|
||||
let monthToShow;
|
||||
let monthStartDateNum = 0;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue