Skip to content

Commit

Permalink
RRULE Evaluation: Apply BYYEARDAY=366 only in leap years.
Browse files Browse the repository at this point in the history
  • Loading branch information
minichma committed Oct 20, 2024
1 parent 564aaa0 commit 8f70269
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Ical.Net/Evaluation/RecurrencePatternEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,8 @@ 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))
.Where(d => d.Year == date1.Year));
}
return yearDayDates;
}
Expand All @@ -483,7 +484,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)
{
goto Next;
}
Expand Down

0 comments on commit 8f70269

Please sign in to comment.