Merge branch 'main' into zomars/cal-585-use-preact-on-production

zomars/cal-585-use-preact-on-production
Omar López 2021-12-10 12:12:36 -07:00 committed by GitHub
commit d95aa22cd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -115,9 +115,12 @@ export const Office365CalendarApiAdapter = (credential: Credential): CalendarApi
return { return {
getAvailability: (dateFrom, dateTo, selectedCalendars) => { getAvailability: (dateFrom, dateTo, selectedCalendars) => {
const filter = `?startdatetime=${encodeURIComponent(dateFrom)}&enddatetime=${encodeURIComponent( const dateFromParsed = new Date(dateFrom);
dateTo const dateToParsed = new Date(dateTo);
)}`;
const filter = `?startdatetime=${encodeURIComponent(
dateFromParsed.toISOString()
)}&enddatetime=${encodeURIComponent(dateToParsed.toISOString())}`;
return auth return auth
.getToken() .getToken()
.then((accessToken) => { .then((accessToken) => {
@ -138,9 +141,6 @@ export const Office365CalendarApiAdapter = (credential: Credential): CalendarApi
const requests = ids.map((calendarId, id) => ({ const requests = ids.map((calendarId, id) => ({
id, id,
method: "GET", method: "GET",
headers: {
Prefer: 'outlook.timezone="Etc/GMT"',
},
url: `/me/calendars/${calendarId}/calendarView${filter}`, url: `/me/calendars/${calendarId}/calendarView${filter}`,
})); }));