Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions graph-app/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -27,8 +27,8 @@
"@ng-bootstrap/ng-bootstrap": "^15.1.1",
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.2",
"date-fns": "^2.30.0",
"date-fns-tz": "^2.0.0",
"date-fns": "4.1.0",
"date-fns-tz": "3.2.0",
"rxjs": "^7.8.0",
"tslib": "^2.6.2",
"windows-iana": "^5.1.0",
Expand Down
6 changes: 3 additions & 3 deletions graph-app/src/app/calendar/calendar.component.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@
import { Component, OnInit } from '@angular/core';
import { parseISO } from 'date-fns';
import { endOfWeek, startOfWeek } from 'date-fns/esm';
import { zonedTimeToUtc } from 'date-fns-tz';
import { fromZonedTime } from 'date-fns-tz';
import { findIana } from 'windows-iana';
import * as MicrosoftGraph from '@microsoft/microsoft-graph-types';

Expand DownExpand Up@@ -36,8 +36,8 @@ export class CalendarComponent implements OnInit {
// but in UTC. For example, for Pacific Standard Time, the time value would be
// 07:00:00Z
const now = new Date();
const weekStart = zonedTimeToUtc(startOfWeek(now), timeZone);
const weekEnd = zonedTimeToUtc(endOfWeek(now), timeZone);
const weekStart = fromZonedTime(startOfWeek(now), timeZone);
const weekEnd = fromZonedTime(endOfWeek(now), timeZone);

this.events = await this.graphService.getCalendarView(
weekStart.toISOString(),
Expand Down