-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fixing Calendar issues related to DST and event organizer timezone being different than user timezone. #2086
Conversation
…ing different than user timezone
Generated by 🚫 dangerJS |
// https://www.timeanddate.com/time/dst/#:~:text=You%20set%20your%20clock%20forward,Daylight%20Savings%20or%20Daylight%20Saving%3F | ||
|
||
const dstOffset = timeZone === "Australia/Lord_Howe" ? 30 : 60; | ||
if (isFirstTimeInDST == isSecondTimeInDST) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be a ===
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
eventDate.add(getDSTAdjustmentMinutes(startDate, eventDate, localTz), "minutes"); | ||
|
||
var localTz = momentTz.tz.guess(); | ||
if (organizerTz != localTz) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be a !==
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -11,18 +11,23 @@ _This release is scheduled to be released on 2020-10-01._ | |||
|
|||
### Added | |||
|
|||
- Added a dependency on 'node-ical' and 'moment-timezone' libraries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there any direct benefits from switching to node-ical?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can see, 'ical' is mainly targeted for pure Javascript environments whereas 'node-ical' will provide more flexibility/functionality in Node environments. This was evident when I tried fixing an incorrect issue parsing start-time timezone using 'ical', but couldn't do it without having to copy all of the timezone database data.
PTAL @rejas |
@rejas, did you (by any chance) test this? |
no, just took a quick look at the code. |
@MichMich - any update on whether this change can be merged or not? |
Sorry for the slow response. This PR has some conflicts I can't fix. Would it be possible four you to fix these conflicts? |
I will take a look this weekend. |
with my all day changes (already merged) and the updated node-ical node library, we don't need this fix. the problem was in ical library.. I am waiting for the node-ical author to publish to node library before submitting pr a sample using ical.js library is listed at the end of #1798 |
Ok, so just to be sure: I can close this PR? |
u should let him confirm, but I believe yes |
It's ok to close this PR if the fixes are already in. I had a separate DST-related fix as well, but will see if it's address based on the other ical fixes - if not I'll submit a new PR. |
I also want to move to node-ical, as ical.js is browser only. I put all the timezone fixes in the node-ical module, where they should be. |
Ok. Closing for now. Thanks for all your hard work, people! |
Does the pull request solve a related issue?
Yes
If so, can you reference the issue?
Calendar event issues with DST and organizer timezone being different #2085
What does the pull request accomplish? Use a list if needed.