Skip to content

Commit e6868a5

Browse files
authored
Merge pull request #356 from arvion-agent/chore/677
[Arvion] Security fix: upgrade package to new version
2 parents a6076a1 + e8bc72b commit e6868a5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

graph-tutorial/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"@microsoft/mgt-element": "^3.1.3",
99
"@microsoft/microsoft-graph-client": "^3.0.7",
1010
"bootstrap": "^5.3.3",
11-
"date-fns": "^2.29.2",
12-
"date-fns-tz": "^2.0.1",
11+
"date-fns": "4.1.0",
12+
"date-fns-tz": "3.2.0",
1313
"react": "^18.3.1",
1414
"react-bootstrap": "^2.10.4",
1515
"react-dom": "^18.3.1",

graph-tutorial/src/GraphService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import { Client, GraphRequestOptions, PageCollection, PageIterator } from '@microsoft/microsoft-graph-client';
66
import { AuthCodeMSALBrowserAuthenticationProvider } from '@microsoft/microsoft-graph-client/authProviders/authCodeMsalBrowser';
77
import { endOfWeek, startOfWeek } from 'date-fns';
8-
import { zonedTimeToUtc } from 'date-fns-tz';
8+
import { fromZonedTime } from 'date-fns-tz';
99
import { User, Event } from '@microsoft/microsoft-graph-types';
1010

1111
let graphClient: Client | undefined = undefined;
@@ -41,8 +41,8 @@ export async function getUserWeekCalendar(authProvider: AuthCodeMSALBrowserAuthe
4141
// Generate startDateTime and endDateTime query params
4242
// to display a 7-day window
4343
const now = new Date();
44-
const startDateTime = zonedTimeToUtc(startOfWeek(now), timeZone).toISOString();
45-
const endDateTime = zonedTimeToUtc(endOfWeek(now), timeZone).toISOString();
44+
const startDateTime = fromZonedTime(startOfWeek(now), timeZone).toISOString();
45+
const endDateTime = fromZonedTime(endOfWeek(now), timeZone).toISOString();
4646

4747
// GET /me/calendarview?startDateTime=''&endDateTime=''
4848
// &$select=subject,organizer,start,end

0 commit comments

Comments
 (0)