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

Fixing Calendar issues related to DST and event organizer timezone being different than user timezone. #2086

Closed
wants to merge 3 commits into from

Conversation

chamakura
Copy link
Contributor

  • Change to use node-ical instead of ical for parsing ics files
  • Fixing issues because of DST offsets
  • If it includes major visual changes please add screenshots.

@MagicMirrorBot
Copy link

Warnings
⚠️

Please include an updated CHANGELOG.md file.
This way we can keep track of all the contributions.

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) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should be a ===

Copy link
Contributor Author

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) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should be a !==

Copy link
Contributor Author

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
Copy link
Collaborator

@rejas rejas Jul 12, 2020

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?

Copy link
Contributor Author

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.

@chamakura
Copy link
Contributor Author

PTAL @rejas

@MichMich
Copy link
Collaborator

@rejas, did you (by any chance) test this?

@rejas
Copy link
Collaborator

rejas commented Jul 17, 2020

@rejas, did you (by any chance) test this?

no, just took a quick look at the code.

@chamakura
Copy link
Contributor Author

@MichMich - any update on whether this change can be merged or not?

@MichMich
Copy link
Collaborator

Sorry for the slow response. This PR has some conflicts I can't fix. Would it be possible four you to fix these conflicts?

@chamakura
Copy link
Contributor Author

I will take a look this weekend.

@sdetweil
Copy link
Collaborator

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
its expected that ical.js will reject this change (also submitted) due to requirement to be in browser only

@MichMich
Copy link
Collaborator

Ok, so just to be sure: I can close this PR?

@sdetweil
Copy link
Collaborator

u should let him confirm, but I believe yes

@chamakura
Copy link
Contributor Author

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.

@sdetweil
Copy link
Collaborator

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.
I also added support for ms timezone names and offset timezones
moment-tz does all the DST adjustment, so mm doesn't have to

@MichMich
Copy link
Collaborator

Ok. Closing for now. Thanks for all your hard work, people!

@MichMich MichMich closed this Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants