Skip to content

Improve TRIGGER DURATION parsing logic #148

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

Merged
merged 2 commits into from
Oct 27, 2018

Conversation

jessejoe
Copy link
Contributor

@jessejoe jessejoe commented Oct 10, 2018

TRIGGER DURATIONs can also take the form TRIGGER;VALUE=DURATION:-PT30M. The existing logic only accounts for TRIGGER:-PT30M.

This can be tested with any of the NHL ical schedules from this season, e.g. https://www.stanza.co/api/schedules/nhl-sabres/nhl-sabres.ics .

Before:

In [2]: cal = ics.Calendar(requests.get('https://www.stanza.co/api/schedules/nhl-sabres/nhl-sabres.ics').text)

ParserError: Could not match input to any of ['YYYY-MM-DDTHH:mm']

After:

In [2]: cal = ics.Calendar(requests.get('https://www.stanza.co/api/schedules/nhl-sabres/nhl-sabres.ics').text)

In [3]: cal.events[0].alarms[0].trigger
Out[3]: datetime.timedelta(0, 1800)

TRIGGER DURATIONs can also take the form `TRIGGER;VALUE=DURATION:-PT30M`. The
existing logic only accounts for `TRIGGER:-PT30M`.
@jessejoe jessejoe force-pushed the improve_trigger_duration_logic branch from defe715 to 0486174 Compare October 10, 2018 17:17
@C4ptainCrunch C4ptainCrunch merged commit b49ad6a into ics-py:master Oct 27, 2018
@C4ptainCrunch
Copy link
Member

Great, thanks !

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 this pull request may close these issues.

2 participants