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 GraphRNSample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@react-navigation/drawer": "^6.6.2",
"@react-navigation/native": "^6.1.9",
"@react-navigation/stack": "^6.3.20",
"date-fns": "^2.30.0",
"date-fns-tz": "^2.0.0",
"date-fns": "4.1.0",
"date-fns-tz": "3.2.0",
"react": "18.2.0",
"react-native": "0.71.7",
"react-native-app-auth": "^6.4.3",
Expand Down
6 changes: 3 additions & 3 deletions GraphRNSample/screens/CalendarScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import {createStackNavigator} from '@react-navigation/stack';
import * as MicrosoftGraph from '@microsoft/microsoft-graph-types';
import {endOfWeek, format, parseISO, startOfWeek} from 'date-fns';
import {zonedTimeToUtc} from 'date-fns-tz';
import {fromZonedTime} from 'date-fns-tz';
import {findIana} from 'windows-iana';

import {UserContext} from '../UserContext';
Expand Down Expand Up @@ -91,11 +91,11 @@ export default class CalendarScreen extends React.Component {
// time zone, but in UTC. For example, for PST, the time value
// would be 07:00:00Z
const now = new Date();
const startDateTime = zonedTimeToUtc(
const startDateTime = fromZonedTime(
startOfWeek(now),
ianaTimeZone,
).toISOString();
const endDateTime = zonedTimeToUtc(
const endDateTime = fromZonedTime(
endOfWeek(now),
ianaTimeZone,
).toISOString();
Expand Down