Fix Outlook & Zoom creating events in UTC#7283
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
joeauyeung
left a comment
There was a problem hiding this comment.
When we would pass event start & end times it would be formatted as 2023-02-22T18:00:00Z. The Z at the end would overwrite any time zones we would pass.
| }; | ||
|
|
||
| private translateEvent = (event: CalendarEvent) => { | ||
| const utcOffset = dayjs(event.startTime, event.organizer.timeZone).utcOffset() / 60; |
There was a problem hiding this comment.
We need to apply the UTC offset because we are passing the start & end times as UTC.
📦 Next.js Bundle AnalysisThis analysis was generated by the next.js bundle analysis action 🤖 This PR introduced no changes to the javascript bundle 🙌 |
* Apply utc offset to time strings * Zoom, create events in proper time zone
* Apply utc offset to time strings * Zoom, create events in proper time zone
* Apply utc offset to time strings * Zoom, create events in proper time zone
| }; | ||
|
|
||
| const recurrence = getRecurrence(event); | ||
| const utcOffset = dayjs(event.startTime, event.organizer.timeZone).utcOffset() / 60; |
There was a problem hiding this comment.
@zomars @joeauyeung I believe this code dayjs(event.startTime, event.organizer.timeZone) is resulting in NaN, which is setting the start_time on L204 to be the current time.
I can reproduce this consistently:
I just tried it again today (3/16) at 2:47pm with the following parameters:
Scheduled the meeting for 3/18 at 11am.
And the zoom meeting was scheduled for today (3/16) at 2:47pm.
There was a problem hiding this comment.
Thanks for finding this @lottamus. I'll look into it


What does this PR do?
This PR fixes events being created in UTC on Outlook & Zoom.
Fixes #6928, fixes #6927
Environment: Staging(main branch) / Production
Type of change
How should this be tested?
Checklist