Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timezone issue #89

Merged
merged 6 commits into from
Aug 29, 2022
Merged

Fix timezone issue #89

merged 6 commits into from
Aug 29, 2022

Conversation

MatthewLamperski
Copy link
Contributor

Reformatted date strings received from Canvas to account for a difference in timezone. This version will create a new ISO date string that considers the user's timezone, and forwards this new ISO time string to Notion, resulting in the correct time being presented to the user. This method uses the timezone that the machine is operating on. So if the user provides a timezone different from the one they are in, for some reason, the time that will go into Notion will be in accordance with the timezone their machine is currently in (i.e. using JavaScript's Date functionality), not the timezone they have manually entered.

…ence in timezone. This version will create a new ISO date string that considers the user's timezone, and forwards this new ISO time string to Notion, resulting in the correct time being presented to the user. This method uses the timezone that the machine is operating on. *So if the user provides a timezone different from the one they are in*, for some reason, the time that will go into Notion will be in accordance with the timezone their machine is currently in (i.e. using JavaScript's Date functionality).
@JamesNZL JamesNZL added the bug Something isn't working label Aug 29, 2022
Copy link
Owner

@JamesNZL JamesNZL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks heaps! Just a tiny style change, and a question out of curiosity.

src/popup/fetch.ts Outdated Show resolved Hide resolved
src/popup/fetch.ts Show resolved Hide resolved
src/popup/fetch.ts Outdated Show resolved Hide resolved
…ded timezone, then calculates the correct date string to give to Notion. Default timezone is 'Pacific/Auckland'.
Copy link
Owner

@JamesNZL JamesNZL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few tiny changes, but looks really good 😄, thanks again!

src/popup/fetch.ts Outdated Show resolved Hide resolved
src/popup/fetch.ts Outdated Show resolved Hide resolved
src/popup/fetch.ts Outdated Show resolved Hide resolved
…ne to guess the user's timezone based on their location if they did not provide a timezone.
Copy link
Owner

@JamesNZL JamesNZL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thank you again ✨

@JamesNZL JamesNZL merged commit 2ed29fe into JamesNZL:main Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants