Merge pull request #1220 from Safelite/feature/Digital/CSR-1475
Update schedule.vue
This commit is contained in:
commit
2af32f9704
1 changed files with 7 additions and 4 deletions
|
|
@ -81,8 +81,11 @@ const getAvailableDates = async (
|
||||||
appointmentType,
|
appointmentType,
|
||||||
providerNumber
|
providerNumber
|
||||||
) => {
|
) => {
|
||||||
const apiEndDateLimit = new Date(startDateString + "T00:00:00");
|
var today = new Date();
|
||||||
const endDate = new Date(endDateString + "T00:00:00");
|
var currentTime = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
|
||||||
|
|
||||||
|
const apiEndDateLimit = new Date(startDateString + "T" + currentTime);
|
||||||
|
const endDate = new Date(endDateString + "T" + currentTime);
|
||||||
apiEndDateLimit.setDate(apiEndDateLimit.getDate() + TIME_SLOTS_CALL_DAYS_LIMIT);
|
apiEndDateLimit.setDate(apiEndDateLimit.getDate() + TIME_SLOTS_CALL_DAYS_LIMIT);
|
||||||
|
|
||||||
// how many days are between startDate and endDate?
|
// how many days are between startDate and endDate?
|
||||||
|
|
@ -90,7 +93,7 @@ const getAvailableDates = async (
|
||||||
const apiCallsCount = Math.ceil(difference / TIME_SLOTS_CALL_DAYS_LIMIT);
|
const apiCallsCount = Math.ceil(difference / TIME_SLOTS_CALL_DAYS_LIMIT);
|
||||||
const storeActionConfigs = [];
|
const storeActionConfigs = [];
|
||||||
const timeSlotsData = {};
|
const timeSlotsData = {};
|
||||||
let apiStartDate = new Date(startDateString + "T00:00:00");
|
let apiStartDate = new Date(startDateString + "T" + currentTime);
|
||||||
let apiEndDate = apiEndDateLimit;
|
let apiEndDate = apiEndDateLimit;
|
||||||
timeSlotsData.days = [];
|
timeSlotsData.days = [];
|
||||||
|
|
||||||
|
|
@ -104,7 +107,7 @@ const getAvailableDates = async (
|
||||||
apiEndDate.setDate(apiEndDate.getDate() + TIME_SLOTS_CALL_DAYS_LIMIT);
|
apiEndDate.setDate(apiEndDate.getDate() + TIME_SLOTS_CALL_DAYS_LIMIT);
|
||||||
}
|
}
|
||||||
if (i === apiCallsCount) {
|
if (i === apiCallsCount) {
|
||||||
apiEndDate = new Date(endDateString + "T00:00:00");
|
apiEndDate = new Date(endDateString + "T" + currentTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (appointmentType === AppointmentTypeStrings.MOBILE) {
|
if (appointmentType === AppointmentTypeStrings.MOBILE) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue