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

Incorrect behavior related to BYWEEKNO together with BYMONTH, BYMONTHDAY #729

Closed
minichma opened this issue Feb 15, 2025 · 0 comments · Fixed by #731
Closed

Incorrect behavior related to BYWEEKNO together with BYMONTH, BYMONTHDAY #729

minichma opened this issue Feb 15, 2025 · 0 comments · Fixed by #731
Labels

Comments

@minichma
Copy link
Collaborator

minichma commented Feb 15, 2025

Describe the bug
Recurrence evaluation produces incorrect results when applying FREQ=YEARLY, BYWEEKNO together with date expansions (i.e. BYMONTH,
BYMONTHDAY, BYYEARDAY)

To Reproduce
The following test cases fail (when added to RecurrenceTestCases.txt)

# 30.12 in WEEK 1 with expansion on BYMONTH, BYMONTHDAY, BYWEEKNO
RRULE:FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=30;BYWEEKNO=1;UNTIL=20320101
DTSTART:20241230
INSTANCES:20241230,20251230,20301230,20311230

# 30.12 in WEEK 52 with expansion on BYMONTH, BYMONTHDAY, BYWEEKNO, which only exists in 2026, 2032, 2027 in the observed range.
RRULE:FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=30;BYWEEKNO=52;UNTIL=20340101
DTSTART:20271230
INSTANCES:20271230,20281230,20291230,20331230

# 30.12 in WEEK 53 with expansion on BYMONTH, BYMONTHDAY, BYWEEKNO
RRULE:FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=30;BYWEEKNO=53;UNTIL=20380101
DTSTART:20261230
INSTANCES:20261230,20321230,20371230

# 2.1 in WEEK 1 with expansion on BYMONTH, BYMONTHDAY, BYWEEKNO
RRULE:FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=2;BYWEEKNO=53;UNTIL=20290102
DTSTART:20250102
INSTANCES:20250102,20260102,20290102

# 2.1 in WEEK 52 with expansion on BYMONTH, BYMONTHDAY, BYWEEKNO
RRULE:FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=2;BYWEEKNO=53;UNTIL=20390102
DTSTART:20280102
INSTANCES:20280102,20390102

# 2.1 in WEEK 53 with expansion on BYMONTH, BYMONTHDAY, BYWEEKNO
RRULE:FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=2;BYWEEKNO=53;UNTIL=20380102
DTSTART:20270102
INSTANCES:20270102,20330102,20380102

Environment (please complete the following information):

  • ical.net version: current main branch (as of 2025-02-15)
@minichma minichma added the bug label Feb 15, 2025
minichma added a commit that referenced this issue Feb 15, 2025
I.e. fix `BYMONTH`, `BYMONTHDAY`, `BYYEARDAY` in relation to `BYWEEKNO`
minichma added a commit that referenced this issue Feb 15, 2025
I.e. fix `BYMONTH`, `BYMONTHDAY`, `BYYEARDAY` in relation to `BYWEEKNO`
minichma added a commit that referenced this issue Feb 16, 2025
I.e. fix `BYMONTH`, `BYMONTHDAY`, `BYYEARDAY` in relation to `BYWEEKNO`
axunonb added a commit that referenced this issue Feb 20, 2025
* Fix #729: incorrect expansion behaviour after `BYWEEKNO`

I.e. fix `BYMONTH`, `BYMONTHDAY`, `BYYEARDAY` in relation to `BYWEEKNO`

* Reduce cyclomatic complexity of `GetWeekNoVariants` to make CodeCov a little happier.

* Make method static to avoid CodeCov complaining.

---------

Co-authored-by: axunonb <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant