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",
|
||||
"styled-components": "3.4.9",
|
||||
"uuid": "3.1.0",
|
||||
"windows-iana": "^3.1.0",
|
||||
"xmldom": "0.1.27"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -12,6 +12,8 @@ import { getShareInfoText } from '../../invite';
|
|||
|
||||
import { setCalendarAPIAuthState } from '../actions';
|
||||
|
||||
import { findWindows } from 'windows-iana';
|
||||
|
||||
/**
|
||||
* 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 '${
|
||||
endDate.toISOString()}'`;
|
||||
|
||||
const ianaTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
const windowsTimeZone = findWindows(ianaTimeZone);
|
||||
|
||||
return client
|
||||
.api(`/me/calendars/${calendarId}/events`)
|
||||
.filter(filter)
|
||||
.header('Prefer', `outlook.timezone="${windowsTimeZone}"`)
|
||||
.select('id,subject,start,end,location,body')
|
||||
.orderby('createdDateTime DESC')
|
||||
.get()
|
||||
|
|
Loading…
Reference in New Issue