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

RRULE Evaluation: Apply BYYEARDAY=366 only in leap years. #621

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Ical.Net/Evaluation/RecurrencePatternEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,9 @@ private List<DateTime> GetYearDayVariants(List<DateTime> dates, RecurrencePatter
var date1 = date;
yearDayDates.AddRange(pattern.ByYearDay.Select(yearDay => yearDay > 0
? date1.AddDays(-date1.DayOfYear + yearDay)
: date1.AddDays(-date1.DayOfYear + 1).AddYears(1).AddDays(yearDay)));
: date1.AddDays(-date1.DayOfYear + 1).AddYears(1).AddDays(yearDay))
minichma marked this conversation as resolved.
Show resolved Hide resolved
// Ignore the BY values that don't fit into the current year (i.e. +-366 in non-leap-years).
.Where(d => d.Year == date1.Year));
}
return yearDayDates;
}
Expand All @@ -483,7 +485,7 @@ private List<DateTime> GetYearDayVariants(List<DateTime> dates, RecurrencePatter
? date.AddDays(-date.DayOfYear + yearDay)
: date.AddDays(-date.DayOfYear + 1).AddYears(1).AddDays(yearDay);

if (newDate.DayOfYear == date.DayOfYear)
if (newDate.Date == date.Date)
minichma marked this conversation as resolved.
Show resolved Hide resolved
{
goto Next;
}
Expand Down
Loading