ical.net icon indicating copy to clipboard operation
ical.net copied to clipboard

Migrating to iCal.net Period - Matches Date Only

Open gjdownes opened this issue 7 years ago • 3 comments

I'm trying to simulate the MatchesDateOnly for my recurrence rule "ExcludeDates" which I'm storing as date only values. I want my RRULE to ignore certain date only periods.

Previously in DDay we could specify:

if (!recurrenceOptions.ExcludeDates.IsNullOrEmpty ())
{
	var periodList = new PeriodList ();

	recurrenceOptions.ExcludeDates.ForEach (d =>
	{
		var period = new Period (new iCalDateTime (d), TimeSpan.FromDays (1)) { MatchesDateOnly = true };
		periodList.Add (period);
	});

	iCalEvent.ExceptionDates.Add (periodList);
}

var occurences = iCalEvent.GetOccurrences (range.StartDate, range.EndDate);

How can I mimic this functionality in iCal.net?

gjdownes avatar Sep 21 '17 15:09 gjdownes