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

Recurrence evaluation: Implement support for negative BYWEEKNO values. #654

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

minichma
Copy link
Collaborator

This PR implements support for negative values in the BYWEEKNO array, like in the following example that is mentioned in #618.

RRULE:FREQ=YEARLY;BYWEEKNO=1,2,-1,-2;BYDAY=TU;UNTIL=20170101T000000Z

This fixes the corresponding task in #618.

…IL=20170101T000000Z` and associated test failure.
Copy link

codecov bot commented Nov 26, 2024

Codecov Report

Attention: Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
Ical.Net/Evaluation/RecurrencePatternEvaluator.cs 89% 0 Missing and 1 partial ⚠️

Impacted file tree graph

@@         Coverage Diff         @@
##           main   #654   +/-   ##
===================================
  Coverage    60%    60%           
===================================
  Files       100    100           
  Lines      4643   4657   +14     
  Branches   1103   1106    +3     
===================================
+ Hits       2797   2811   +14     
  Misses     1379   1379           
  Partials    467    467           
Files with missing lines Coverage Δ
Ical.Net/CalendarExtensions.cs 100% <100%> (ø)
Ical.Net/Evaluation/RecurrencePatternEvaluator.cs 69% <89%> (+1%) ⬆️

@minichma minichma force-pushed the work/minichma/bugfix/recur_weekno branch from 2bd69c4 to f7697a3 Compare November 26, 2024 21:04
@minichma minichma marked this pull request as ready for review November 26, 2024 21:04
@minichma minichma requested a review from axunonb November 26, 2024 21:04
@minichma minichma linked an issue Nov 26, 2024 that may be closed by this pull request
8 tasks
// The last week of the year is the week that contains the 4th-last day of the year (which is the 28th of December in Gregorian Calendar).
var testTime = new DateTime(year + 1, 1, 1, 0, 0, 0, DateTimeKind.Unspecified).AddDays(-4);
return calendar.GetIso8601WeekOfYear(testTime, firstDayOfWeek);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

Copy link
Collaborator

@axunonb axunonb left a comment

Choose a reason for hiding this comment

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

Wow!

@axunonb axunonb merged commit 2419348 into main Nov 27, 2024
6 of 7 checks passed
@axunonb axunonb deleted the work/minichma/bugfix/recur_weekno branch November 27, 2024 08:41
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.

Evaluate some tests failing from the libical test suite.
2 participants