-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from HESPUL/support_multiple_rrule
Add support of multiple RRULE
- Loading branch information
Showing
4 changed files
with
57 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
PRODID:-//CyrusIMAP.org/Cyrus | ||
3.9.0-alpha0-85-gd6d859e0cf-fm-20230116.001-gd6d859e0//EN | ||
BEGIN:VEVENT | ||
CREATED:20230109T084023Z | ||
LAST-MODIFIED:20230119T110732Z | ||
DTSTAMP:20230119T110732Z | ||
UID:56cdc4dc-11b7-407c-86c6-9faedfc28afb | ||
SUMMARY:My repeating event | ||
RRULE:FREQ=WEEKLY;BYDAY=TH;COUNT=20 | ||
RRULE:FREQ=MONTHLY;BYDAY=2MO;COUNT=2 | ||
DTSTART;TZID=Europe/London:20230112T100000 | ||
DTEND;TZID=Europe/London:20230112T120000 | ||
END:VEVENT | ||
END:VCALENDAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
from datetime import date | ||
|
||
|
||
def test_multiple_rrule(calendars): | ||
events = calendars.multiple_rrule.at(2023) | ||
assert len(events) == 20 + 2 | ||
event_dstarts = [event['DTSTART'].dt.date() for event in events] | ||
assert date(2023,2,9) in event_dstarts | ||
assert date(2023,2,13) in event_dstarts | ||
assert date(2023,2,16) in event_dstarts | ||
assert date(2023,3,13) in event_dstarts |