Nuget version: v4.1.11
Observed behavior:: Four periods are returned after evaluating, even though they fall before the periodStart date.
Expected behavior: Zero periods since the last one is on November 3rd, 2019 and periodStart starts from December 1st, 2019.
An event string is made that created a recurrence for every first, second and fourth Sunday for four times starting from October 6th, 2019. These dates are:
October 6th, 2019
October 13th, 2019
October 27th, 2019
November 3rd, 2019
I evaluate this against a periodStart of December 1st, 2019 and a periodEnd of December 1st, 2020. I expect no periods to return, but all the periods above still get returned.
Here is a unit test that showcases the problem:
[TestMethod]
public void HasNoOccurencerAfter_MONTHLY_COUNT4_THRICEAMONTH()
{
var fromDate = new DateTime(2019, 12, 01);
var eventString = $"BEGIN:VEVENT\nDTSTART:20191006T000000Z\nRRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=4;WKST=MO;BYDAY=+1SU,+2SU,+4SU\nEND:VEVENT";
var vEvents = Calendar.Load<CalendarEvent>(eventString);
var evt = vEvents.FirstOrDefault();
var evtEval = new EventEvaluator(evt);
var periods = evtEval.Evaluate(evt.Start, fromDate, fromDate.AddYears(1), false);
Assert.IsFalse(periods.Any());
}
Nuget version: v4.1.11 Observed behavior:: Four periods are returned after evaluating, even though they fall before the periodStart date. Expected behavior: Zero periods since the last one is on November 3rd, 2019 and periodStart starts from December 1st, 2019.
An event string is made that created a recurrence for every first, second and fourth Sunday for four times starting from October 6th, 2019. These dates are:
I evaluate this against a periodStart of December 1st, 2019 and a periodEnd of December 1st, 2020. I expect no periods to return, but all the periods above still get returned.
Here is a unit test that showcases the problem: