Merge pull request #1236 from Safelite/feature/Digital/CSR-1475-revert

Revert "Update schedule.vue"
This commit is contained in:
hiteshkumar87 2023-07-17 12:03:55 +05:30 committed by GitHub
commit bc98d3f616
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -81,11 +81,8 @@ const getAvailableDates = async (
appointmentType,
providerNumber
) => {
var today = new Date();
var currentTime = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
const apiEndDateLimit = new Date(startDateString + "T" + currentTime);
const endDate = new Date(endDateString + "T" + currentTime);
const apiEndDateLimit = new Date(startDateString + "T00:00:00");
const endDate = new Date(endDateString + "T00:00:00");
apiEndDateLimit.setDate(apiEndDateLimit.getDate() + TIME_SLOTS_CALL_DAYS_LIMIT);
// how many days are between startDate and endDate?
@ -93,7 +90,7 @@ const getAvailableDates = async (
const apiCallsCount = Math.ceil(difference / TIME_SLOTS_CALL_DAYS_LIMIT);
const storeActionConfigs = [];
const timeSlotsData = {};
let apiStartDate = new Date(startDateString + "T" + currentTime);
let apiStartDate = new Date(startDateString + "T00:00:00");
let apiEndDate = apiEndDateLimit;
timeSlotsData.days = [];
@ -107,7 +104,7 @@ const getAvailableDates = async (
apiEndDate.setDate(apiEndDate.getDate() + TIME_SLOTS_CALL_DAYS_LIMIT);
}
if (i === apiCallsCount) {
apiEndDate = new Date(endDateString + "T" + currentTime);
apiEndDate = new Date(endDateString + "T00:00:00");
}
if (appointmentType === AppointmentTypeStrings.MOBILE) {