Skip to content

Adding exception dates to CalendarEvent #741

Answered by axunonb
mbowles201 asked this question in Q&A
Discussion options

You must be logged in to vote

Here is an example from one of the unit tests how to add ExceptionDates to a CalendarEvent. Hope this helps.

public void AddExDateToEventAfterGetOccurrencesShouldRecomputeResult()
{
var searchStart = _now.AddDays(-1);
var searchEnd = _now.AddDays(7);
var e = GetEventWithRecurrenceRules();
var occurrences = e.GetOccurrences(searchStart, searchEnd).ToList();
Assert.That(occurrences, Has.Count.EqualTo(5));
var exDate = _now.AddDays(1);
e.ExceptionDates.Add(new CalDateTime(exDate, false));
occurrences = e.GetOccurrences(searchStart, searchEnd).ToList();
A…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@mbowles201
Comment options

@axunonb
Comment options

@mbowles201
Comment options

Answer selected by mbowles201
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants