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] Calendar-Module: Event start time correction based on time zone #2634

Merged
merged 6 commits into from Aug 29, 2021
Merged

[Fix] Calendar-Module: Event start time correction based on time zone #2634

merged 6 commits into from Aug 29, 2021

Conversation

jupadin
Copy link
Contributor

@jupadin jupadin commented Aug 22, 2021

  1. Base your pull requests against the develop branch.

Done.

  1. Include these infos in the description:
  • Does the pull request solve a related issue?
  • If so, can you reference the issue like this Fixes #<issue_number>?
  • What does the pull request accomplish? Use a list if needed.
  • If it includes major visual changes please add screenshots.

PR fixes #2632.
The time zone correction was only applied if the date hour of the event is smaller than the actual time zone offset.
In my case the date hour was equal the time zone offset but since the javascript date object is able to handle this case (and maybe also the case where the time zone offset is bigger than the date hour) this check is not necessary any longer and also prevents the start date correction.

  1. Please run npm run lint:prettier before submitting so that
    style issues are fixed.

Done.

  1. Don't forget to add an entry about your changes to
    the CHANGELOG.md file.

Done.

Note: Sometimes the development moves very fast. It is highly
recommended that you update your branch of develop before creating a
pull request to send us your changes. This makes everyone's lives
easier (including yours) and helps us out on the development team.

Done.

@codecov-commenter
Copy link

codecov-commenter commented Aug 22, 2021

Codecov Report

Merging #2634 (cfff2ad) into develop (ff0ab24) will increase coverage by 0.54%.
The diff coverage is 89.47%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2634      +/-   ##
===========================================
+ Coverage    70.47%   71.01%   +0.54%     
===========================================
  Files           16       16              
  Lines          823      828       +5     
===========================================
+ Hits           580      588       +8     
+ Misses         243      240       -3     
Impacted Files Coverage Δ
modules/default/calendar/calendarutils.js 60.44% <89.47%> (+1.89%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff0ab24...cfff2ad. Read the comment docs.

@@ -296,38 +307,42 @@ const CalendarUtils = {
// Loop through the set of date entries to see which recurrences should be added to our event list.
for (let d in dates) {
let date = dates[d];
// FIXME: We now use node-ical instead of ical.js, but method stays the same.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thats alittle unclear, what should be fixed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The comment says that we use(d) ical.js to parse the ical-file, which was changed in v 2.15. if I remember correctly.
Currently we are using node-ical, such that the comment is out of date but the method is still valid.
Maybe there is more elegant way using a built-in method, since the date variable represents a date object - but I have to double check this.
In both cases the comment has to be changed or removed but since this does not affect the issue and just served as a reminder.

Currently I'm reviewing the whole calendar module, making simplifications and refactoring such that I will have a second look on it :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

So basically the comment should just be changed to say "node-ical" instead of "ical" , right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, as well as line 313 (I don't know how to mark or link this line), since it also talks about ical.js.

Can you do this or do I have to redo the PR?

For further PR the whole procedure might change, since we could maybe use a built-in function - but this is another topic.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can just add another commit with the changes to your branch and push it. The PR will get updated automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, perfect. Thank you very much!
I'm going to update the PR in a few seconds :)

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.

None yet

7 participants