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

2901: Fix recurring dates yet again #2902

Merged
merged 7 commits into from
Sep 3, 2024

Conversation

LeandraH
Copy link
Contributor

@LeandraH LeandraH commented Aug 28, 2024

Short description

When rewriting the recurrent dates a few weeks ago, I missed a test case: repeating an event every nth week of the month.

In that case, the recurrence rule gets the parameter BYDAY=+3TH. When parsing that, our package rrule turns that not into the parameter byweekday but into the parameter bynweekday (the n stands for nth weekday). When turning the parameter bynweekday back into a string, we get the parameter BYNWEEKDAY=3,+3, which doesn't seem to be a valid parameter.

So I decided to stick to the string of the recurrence rule as the source of truth and not the recurrence rule object from our rrule package.

You can also see some fun workarounds in this issue: jkbrzt/rrule#326

Proposed changes

  • Get the recurrence rule that has been offset by our timezone via the string of the rule, not the object from the package
  • MORE TESTS (if you see more missing test cases, please tell me)

Side effects

  • Hopefully none

Testing

Run the tests in your environment
Check particularly that events repeating every nth day (e.g. every 4th Friday) are showing correctly http://localhost:9000/testumgebung/de/events/test-monthly
Any other repeating event combinations that you can think of

Resolved issues

Fixes: #2901


Copy link
Member

@steffenkleinle steffenkleinle left a comment

Choose a reason for hiding this comment

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

Works like a charm, thanks for fixing all this stuff! 💚

shared/api/models/DateModel.ts Outdated Show resolved Hide resolved
@LeandraH
Copy link
Contributor Author

LeandraH commented Sep 3, 2024

@ztefanie or @f1sh1918 it would be cool if one of you could still review this PR this week :)

@LeandraH LeandraH enabled auto-merge September 3, 2024 11:48
Copy link

codeclimate bot commented Sep 3, 2024

Code Climate has analyzed commit b2b7a35 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 74.0%.

View more on Code Climate.

@LeandraH LeandraH merged commit e5bafc8 into main Sep 3, 2024
8 checks passed
@LeandraH LeandraH deleted the 2901-Fix-recurring-dates-yet-again branch September 3, 2024 11:55
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.

Events recurring every last Wednesday of the month are broken
3 participants