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

RDATE not working: getrruleset returns empty generator #83

Closed
Unrud opened this issue Jun 24, 2017 · 3 comments · Fixed by #85
Closed

RDATE not working: getrruleset returns empty generator #83

Unrud opened this issue Jun 24, 2017 · 3 comments · Fixed by #85
Milestone

Comments

@Unrud
Copy link
Contributor

Unrud commented Jun 24, 2017

If RDATE is used, getrruleset returns an empty generator.

Example:

import vobject
s="""\
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
BEGIN:VTIMEZONE
TZID:Europe/Paris
BEGIN:STANDARD
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:CET
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
TZNAME:CEST
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
UID:event
DTSTART;TZID=Europe/Paris:20170601T080000
DTEND;TZID=Europe/Paris:20170601T090000
CREATED:20170601T060000Z
DTSTAMP:20170601T060000Z
LAST-MODIFIED:20170601T060000Z
RDATE;TZID=Europe/Paris:20170701T080000
SUMMARY:event
TRANSP:OPAQUE
X-MOZ-GENERATION:1
END:VEVENT
END:VCALENDAR"""
o = vobject.readOne(s)
r = o.vevent.getrruleset(addRDate=True)
print(list(r))

Output: []

@wpercy
Copy link
Contributor

wpercy commented Jun 26, 2017

This looks like a Python 2/3 compatibility issue - it works for me on Python 2.7.12 but not on 3.6.1.

@Unrud
Copy link
Contributor Author

Unrud commented Jun 26, 2017

it works for me on Python 2.7.12

I get the following result in Python 2:

[datetime.datetime(2017, 7, 1, 8, 0, tzinfo=<tzicalvtz 'Europe/Paris'>)]

It only includes the RDATE but not DTSTART. I expected that it is included because of addRDate=True.

@wpercy
Copy link
Contributor

wpercy commented Jun 26, 2017

Yeah, it looks like it only actually adds the DTSTART value if there's exists an RRULE property, I'm looking into it now.

@wpercy wpercy modified the milestone: 0.9.5 Jun 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants