From 93749b187e66d3ed0394a836d79ac302db02b66e Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Wed, 2 Aug 2023 10:48:22 -0400 Subject: [PATCH] CSR-886: a few logic changes found during unit test creation --- src/digital-components/date-picker/date-picker.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue index bd1ce8fe2..0683a9180 100644 --- a/src/digital-components/date-picker/date-picker.vue +++ b/src/digital-components/date-picker/date-picker.vue @@ -174,9 +174,8 @@ export default { return this.todayDateNum + (6 - this.todayDayIndex); }, calendarViewDirection() { - if (this.selectableDatesSetting === "past") return "past"; if (this.selectableDatesSetting === "custom") return "future"; - return "none"; + return "past"; }, selectedDate: { get() { @@ -428,7 +427,7 @@ export default { } else if (direction === "past") { // first 0, then -1 for (let i = 0; i >= 0 - monthsBeforeToLoadOffset; i--) { - months.unshift(this.getMonthData(i, options)); + months.unshift(await this.getMonthData(i, options)); } } else { // TODO - IF A CALENDAR WITH BOTH PAST AND FUTURE WAS EVER NEEDED @@ -610,7 +609,7 @@ export default { // find the first day-hidden to become the next api call start date monthStartDateNum = monthToShow.dates.find(({ dayClasses }) => dayClasses.includes("day-hidden")) - .dateNum - 1; // TRY 2 + .dateNum - 1; } else { if (this.calendarViewDirection === "future") { monthToShow = this.months.find((month) => @@ -646,11 +645,12 @@ export default { this.$store.getters.order.serviceLocation.appointmentType, this.$store.getters.order.serviceLocation.provider.providerNumber ); + moreSelectableDates.days.forEach((selectableDate) => { const index = this.selectableDatesData.findIndex( (dateObj) => dateObj.date === selectableDate.date ); - if (index === -1) this.selectableDatesData.push(selectableDate.date); + if (index === -1) this.selectableDatesData.push(selectableDate); this.months.forEach((month) => { // TODO: avoid checking all calendar dates; maybe only ones between monthStart and monthEnd as defined above? month.dates.forEach((date) => {