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

Better support for RDATE with VALUE=PERIOD #156

Closed
geier opened this issue Jan 30, 2015 · 3 comments · Fixed by #456
Closed

Better support for RDATE with VALUE=PERIOD #156

geier opened this issue Jan 30, 2015 · 3 comments · Fixed by #456

Comments

@geier
Copy link
Collaborator

geier commented Jan 30, 2015

We currently do not support RDATE;VALUE=PERIOD: properly. Below are some examples more or less taken from the RFC.

In [1]: import icalendar

In [2]: event_str = """BEGIN:VEVENT
SUMMARY:RDATE period
DTSTART:19961230T020000Z
DTEND:19961230T060000Z
UID:rdate_period
RDATE;VALUE=PERIOD:19970101T180000Z/19970102T070000Z
END:VEVENT
"""

In [3]: event = icalendar.Event.from_ical(event_str)

In [4]: print(event.to_ical())
BEGIN:VEVENT
SUMMARY:RDATE period
DTSTART:19961230T020000Z
DTEND:19961230T060000Z
UID:rdate_period
RDATE;VALUE=PERIOD:19970101T180000Z
END:VEVENT

another example:

In [5]: event_str = """BEGIN:VEVENT
   ...: SUMMARY:RDATE period
   ...: DTSTART:19961230T020000Z
   ...: DTEND:19961230T060000Z
   ...: UID:rdate_period
   ...: RDATE;VALUE=PERIOD:19970101T180000Z/19970102T070000Z,199709T180000Z/PT5H30M
   ...: END:VEVENT
   ...: """

In [6]: event = icalendar.Event.from_ical(event_str)

In [7]: 

In [7]: print(event.to_ical())
BEGIN:VEVENT
SUMMARY:RDATE period
DTSTART:19961230T020000Z
DTEND:19961230T060000Z
UID:rdate_period
RDATE;VALUE=PERIOD:19970101T180000Z,19970109T180000Z
END:VEVENT
@niccokunzmann
Copy link
Member

I added #456 to test that the examples are parsed and validly put back into ICS.
To close this issue, we also need to make sure that the values stored in the RDATE are valid

@niccokunzmann
Copy link
Member

@geier, there is an error on one of the examples:

199709T180000Z/PT5H30M # given
1997__09T180000Z/PT5H30M # month expected

niccokunzmann added a commit that referenced this issue Oct 13, 2022
@geier
Copy link
Collaborator Author

geier commented Oct 19, 2022

thanks for taking care of this.

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