microsoftCalendar: add showing calendar events in local timezone.
This commit is contained in:
parent
7ce0def995
commit
8da0552541
|
@ -85,6 +85,7 @@
|
||||||
"redux-thunk": "2.2.0",
|
"redux-thunk": "2.2.0",
|
||||||
"styled-components": "3.4.9",
|
"styled-components": "3.4.9",
|
||||||
"uuid": "3.1.0",
|
"uuid": "3.1.0",
|
||||||
|
"windows-iana": "^3.1.0",
|
||||||
"xmldom": "0.1.27"
|
"xmldom": "0.1.27"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -12,6 +12,8 @@ import { getShareInfoText } from '../../invite';
|
||||||
|
|
||||||
import { setCalendarAPIAuthState } from '../actions';
|
import { setCalendarAPIAuthState } from '../actions';
|
||||||
|
|
||||||
|
import { findWindows } from 'windows-iana';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constants used for interacting with the Microsoft API.
|
* Constants used for interacting with the Microsoft API.
|
||||||
*
|
*
|
||||||
|
@ -560,9 +562,13 @@ function requestCalendarEvents( // eslint-disable-line max-params
|
||||||
startDate.toISOString()}' and End/DateTime lt '${
|
startDate.toISOString()}' and End/DateTime lt '${
|
||||||
endDate.toISOString()}'`;
|
endDate.toISOString()}'`;
|
||||||
|
|
||||||
|
const ianaTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||||
|
const windowsTimeZone = findWindows(ianaTimeZone);
|
||||||
|
|
||||||
return client
|
return client
|
||||||
.api(`/me/calendars/${calendarId}/events`)
|
.api(`/me/calendars/${calendarId}/events`)
|
||||||
.filter(filter)
|
.filter(filter)
|
||||||
|
.header('Prefer', `outlook.timezone="${windowsTimeZone}"`)
|
||||||
.select('id,subject,start,end,location,body')
|
.select('id,subject,start,end,location,body')
|
||||||
.orderby('createdDateTime DESC')
|
.orderby('createdDateTime DESC')
|
||||||
.get()
|
.get()
|
||||||
|
|
Loading…
Reference in New Issue