Skip to content

Conversation

@shime
Copy link

@shime shime commented Nov 22, 2023

Hey Nando,

Thank you for the wonderful gem, we have been using it for years and it's really useful.

@pmrazovic has noticed a bug with how it handles weekday option when shift is enabled, so this PR fixes it.
We give users access to specify the rules for recurrence so we generally always want to enable shift.

Without the fix these are the first three Recurrence events for

r = Recurrence.new(every: :month, starts: "2011-01-31", on: "first", weekday: "monday", shift: true)
r.events
2011-02-07 ← first Monday of the month
2011-03-28 ← not the first Monday of the month
2011-09-26 ← not the first Monday of the month

This is with the fix:

2011-02-07 ←  first Monday of the month
2011-03-07 ←  first Monday of the month
2011-04-04 ←  first Monday of the month

@shime
Copy link
Author

shime commented Nov 22, 2023

Not sure why the tests are failing, I've tried updating the to_s(:date) references but that still didn't fix them, although it works locally™.

fnando added a commit that referenced this pull request May 29, 2025
fnando added a commit that referenced this pull request May 29, 2025
fnando added a commit that referenced this pull request May 29, 2025
@fnando
Copy link
Owner

fnando commented May 29, 2025

Closed via #41

@fnando fnando closed this May 29, 2025
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.

2 participants