Skip to content
New issue

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

Something like Event.GetOverlappingOccurrences() would be useful #161

Open
rianjs opened this issue Oct 18, 2016 · 0 comments
Open

Something like Event.GetOverlappingOccurrences() would be useful #161

rianjs opened this issue Oct 18, 2016 · 0 comments

Comments

@rianjs
Copy link
Collaborator

rianjs commented Oct 18, 2016

Sometimes you want to find events that overlap with a given search range, as opposed to starting within it.

[Test, Category("Recurrence")]
public void Foo()
{
    var iCal = Calendar.LoadFromStream(new StringReader(@"
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20150816T223000
DTEND:20150821T063000
RRULE:FREQ=WEEKLY;BYDAY=SU
END:VEVENT
END:VCALENDAR
"))[0];
    // Missing occurrence is from 10-09 through 10-14, which overlaps 10-11 through 10-17
    EventOccurrenceTest(
        iCal,
        new CalDateTime(2016, 10, 11, _tzid),
        new CalDateTime(2016, 10, 17, _tzid),
        new[]
        {
            new CalDateTime(2016, 10, 9, 22, 30, 0, _tzid),
            new CalDateTime(2016, 10, 16, 22, 30, 0, _tzid),
        },
        null
    );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant