Merge pull request #2517 from Safelite/rlsmerge/2025.05.14-to-develop

Rlsmerge/2025.05.14 to develop
This commit is contained in:
AdamCaouetteSafelite 2025-05-14 11:03:57 -04:00 committed by GitHub
commit 72d3efee90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -688,17 +688,18 @@ export default {
if (!this.months) return; if (!this.months) return;
this.isLoading = true; this.isLoading = true;
let monthToShow; let monthToShow;
let monthStartDateNum = 0; let monthStartDate;
if (this.hideSomeDaysForInitialView) { if (this.hideSomeDaysForInitialView) {
monthToShow = this.months.find( monthToShow = this.months.find(
({ isMonthThatHidesSomeDaysForInitialView }) => ({ isMonthThatHidesSomeDaysForInitialView }) =>
isMonthThatHidesSomeDaysForInitialView isMonthThatHidesSomeDaysForInitialView
); );
// find the first day-hidden to become the next api call start date // find the first day-hidden to become the next api call start date
monthStartDateNum = monthStartDate = monthToShow.dates.find(({ dayClasses }) =>
monthToShow.dates.find(({ dayClasses }) => dayClasses.includes("day-hidden")) dayClasses.includes("day-hidden")
.dateNum - 1; );
} else { } else {
if (this.calendarViewDirection === "future") { if (this.calendarViewDirection === "future") {
monthToShow = this.months.find((month) => monthToShow = this.months.find((month) =>
@ -713,9 +714,13 @@ export default {
} }
} }
if (monthToShow) { if (monthToShow) {
const monthStartDateString = monthStartDate
? monthStartDate.inputValue
: monthToShow.dates[0].inputValue;
// make new API call with this month's start and end dates // make new API call with this month's start and end dates
const moreSelectableDatesData = await this.updateSelectableDates( const moreSelectableDatesData = await this.updateSelectableDates(
monthToShow.dates[monthStartDateNum].inputValue, monthStartDateString,
monthToShow.dates[monthToShow.dates.length - 1].inputValue monthToShow.dates[monthToShow.dates.length - 1].inputValue
); );
this.isLoading = false; this.isLoading = false;