when resetting date picker, reset local flags

This commit is contained in:
Bill Richardson 2026-02-02 16:07:25 -05:00
parent 9de93b9c97
commit 70e927748d

View file

@ -461,7 +461,7 @@ export default {
const initialEndDate = new Date(); const initialEndDate = new Date();
initialEndDate.setDate(initialEndDate.getDate() + (initialDays - 1)); initialEndDate.setDate(initialEndDate.getDate() + (initialDays - 1));
let initialViewEndDate = convertDateToDateString(initialEndDate); let initialViewEndDate = convertDateToDateString(initialEndDate);
const preSelectedDate = this.mainStore.order.schedule.date; const preSelectedDate = this.selectedDate;
const endDateObject = this.getEndDateForExistingDate( const endDateObject = this.getEndDateForExistingDate(
todayDateObject, todayDateObject,
@ -609,12 +609,18 @@ export default {
} }
}, },
async refreshDatePicker() { async refreshDatePicker() {
this.resetLocalFlags();
await this.getDatePickerInitialData().then((data) => { await this.getDatePickerInitialData().then((data) => {
this.selectableDatesData = data.initialShopTimeSlotsResponse; this.selectableDatesData = data.initialShopTimeSlotsResponse;
this.$refs.datePicker.initializeComponent(data); this.$refs.datePicker.initializeComponent(data);
showIssLoadingModal(false); showIssLoadingModal(false);
}); });
}, },
resetLocalFlags() {
this.selectedDate = null;
this.selectedTimeSlotInfo = null;
this.showDatePickerError = false;
},
timeSlotSelectedFromPicker(timeSlot) { timeSlotSelectedFromPicker(timeSlot) {
this.selectedTimeSlotInfo = timeSlot; this.selectedTimeSlotInfo = timeSlot;
this.showDatePickerError = false; this.showDatePickerError = false;