niccokunzmann/python-recurring-ical-events

bug: between breaks if RDATE is an interval

natashamm opened this issue · 4 comments

Describe the bug

between breaks if RDATE is an interval. I'm not sure if it is an issues with dateutil or recurring events.

To Reproduce

import datetime
import recurring_ical_events
import pytz

today = datetime.datetime.now(pytz.timezone("America/Vancouver")).date()
future = today + datetime.timedelta(days=365)
for event in cal_i.walk("VEVENT") + cal_i.walk("VFREEBUSY"):
    if event.has_key('RDATE'):
        if (event.has_key('RDATE')):
            recurring_ical_events.of(event).between(today - datetime.timedelta(days=60), future)

ICS file

BEGIN:VCALENDAR
VERSION:2.0
X-WR-CALNAME;VALUE=TEXT:Test RDATE
BEGIN:VTIMEZONE
TZID:America/Vancouver
BEGIN:STANDARD
DTSTART:20221106T020000
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
RDATE:20231105T020000
TZNAME:PST
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:20230312T020000
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
RDATE:20240310T020000
TZNAME:PDT
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
UID:1
DESCRIPTION:Test RDATE
DTSTART;TZID=America/Vancouver:20230920T120000
DTEND;TZID=America/Vancouver:20230920T140000
EXDATE;TZID=America/Vancouver:20231220T120000
RDATE;VALUE=PERIOD;TZID=America/Vancouver:20231213T120000/20231213T140000
RRULE:FREQ=MONTHLY;COUNT=9;INTERVAL=1;BYDAY=+3WE;B/YMONTH=1,2,3,4,5,9,10,11,
 12;WKST=MO
SUMMARY:Test RDATE
END:VEVENT

END:VCALENDAR

Version:

2.0.2


We're using [Polar.sh](https://polar.sh/niccokunzmann) so you can upvote and help fund this issue. We receive the funding once the issue is completed & confirmed by you. Thank you in advance for helping prioritize & fund our work. Fund with Polar

Thanks for reporting this @natashamm! #74 is related. I like that there is actually a use-case for this!

Hi @natashamm. sorry - this was a wrong statement! I read EXRULE.

@natashamm, this should be fixed in v2.1.0. Can you confirm this to close this issue?

Confirmed this is fixed. Thank you!