Skip to content

Fix timezones being returned from office 365#1269

Merged
PeerRich merged 2 commits intocalcom:mainfrom
sec0ndhand:fix/fix-dates-not-being-returned-properly-from-office-365
Dec 10, 2021
Merged

Fix timezones being returned from office 365#1269
PeerRich merged 2 commits intocalcom:mainfrom
sec0ndhand:fix/fix-dates-not-being-returned-properly-from-office-365

Conversation

@sec0ndhand
Copy link
Copy Markdown
Contributor

What does this PR do?

The problem

When scheduling on cal.com my calendar is not preventing times from being scheduled.

Reproducible Proof

If you visit this event You can watch the network requests come back with GMT and no times filtered. If you load the times as if in UTC it filters the dates(but you have to click on the 16th).

Solution

Per the microsoft graph api documentation
the Prefer: outlook.timezone is ignored if a timezone value is passed
in the request. This forces the dates to be passed in UTC.

I don't know if there is a formal issue filed already, I talked to Conner in the support chat this morning and haven't heard back, so this is my attempt to fix it.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

  • I was unable to test locally as I failed to set up office 365 properly

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code and corrected any misspellings
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Per the [api documentation](https://docs.microsoft.com/en-us/graph/api/calendar-list-calendarview?view=graph-rest-1.0&tabs=javascript#query-parameters)
the `Prefer: outlook.timezone` is ignored if a timezone value is passed
in the request.  This forces the dates to be passed in UTC.
@vercel
Copy link
Copy Markdown

vercel bot commented Dec 7, 2021

@sec0ndhand is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@pumfleet pumfleet requested a review from emrysal December 8, 2021 09:36
@PeerRich PeerRich requested a review from KATT December 10, 2021 13:16
@PeerRich
Copy link
Copy Markdown
Member

we need to test this locally or on staging 🙏

@vercel
Copy link
Copy Markdown

vercel bot commented Dec 10, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/cal/calendso/GCAwrCmNxGMmo6A1d5BUKgQTRtKs
✅ Preview: https://calendso-git-fork-sec0ndhand-fix-fix-dates-not-being-6f5d98-cal.vercel.app

@vercel vercel bot temporarily deployed to Preview December 10, 2021 18:09 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ autoupdate tells kodiak to keep this branch up-to-date

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants