We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Recurrable components are mutable -- rules can be created at will, so caching the result of a previous computation is potentially invalid:
[Test] public void AddExDateToEventAfterGetOccurrencesShouldRecomputeResult() { var searchStart = _now.AddDays(-1); var searchEnd = _now.AddDays(7); var e = GetEventWithRecurrenceRules(); var occurrences = e.GetOccurrences(searchStart, searchEnd); Assert.IsTrue(occurrences.Count == 5); var exDate = _now.AddDays(1); var period = new Period(new CalDateTime(exDate)); var periodList = new PeriodList {period}; e.ExceptionDates.Add(periodList); occurrences = e.GetOccurrences(searchStart, searchEnd); Assert.IsTrue(occurrences.Count == 4); //Specifying just a date should "black out" that date var excludeTwoDaysFromNow = _now.AddDays(2).Date; period = new Period(new CalDateTime(excludeTwoDaysFromNow)); periodList.Add(period); occurrences = e.GetOccurrences(searchStart, searchEnd); Assert.IsTrue(occurrences.Count == 3); } private static readonly DateTime _now = DateTime.Now; private static readonly DateTime _later = _now.AddHours(1); private static Event GetEventWithRecurrenceRules() { var dailyForFiveDays = new RecurrencePattern(FrequencyType.Daily, 1) { Count = 5, }; var calendarEvent = new Event { Start = new CalDateTime(_now), End = new CalDateTime(_later), RecurrenceRules = new List<IRecurrencePattern> { dailyForFiveDays }, Resources = new HashSet<string>(new[] {"Foo", "Bar", "Baz"}), }; return calendarEvent; }
EXDATE values that specify only a date should "black out" occurrences where the start time of the event falls on that date.
EXDATE
The text was updated successfully, but these errors were encountered:
GetOccurrences shouldn't cache the result of a previous computation, …
a759d3d
…because rules and data governing recurrence sets are mutable after the event is created. #223
de1f045
Available in nuget version 2.2.29
Sorry, something went wrong.
I've run across an issue with the current fix today: An EXDATE with datetime at midnight also "blacks out" all occurrences that fall on that date.
BEGIN:VEVENT DTEND;TZID=Europe/Amsterdam:20180308T040000 DTSTAMP:20180322T094247Z DTSTART;TZID=Europe/Amsterdam:20180308T040000 EXDATE:20180309T000000 RRULE:FREQ=HOURLY;INTERVAL=4 SEQUENCE:0 UID:9f449bf5-c4ec-48cb-8a29-439d9088e14c END:VEVENT
In the example above all occurrences on March 9th are excluded, the expected result was only the occurrence at midnight was excluded.
No branches or pull requests
Recurrable components are mutable -- rules can be created at will, so caching the result of a previous computation is potentially invalid:
EXDATE
values that specify only a date should "black out" occurrences where the start time of the event falls on that date.The text was updated successfully, but these errors were encountered: