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

Adds Montrose ical RRULE parsing #139

Merged
merged 33 commits into from
Feb 7, 2021
Merged

Adds Montrose ical RRULE parsing #139

merged 33 commits into from
Feb 7, 2021

Conversation

rossta
Copy link
Owner

@rossta rossta commented Feb 7, 2021

This PR adds a long requested feature of parsing ICAL RRULES, as described by RFC 5545, Section 3.8.5.

Example:

ical = <<~ICAL
  DTSTART;TZID=America/New_York:19970922T090000
  RRULE:FREQ=MONTHLY;COUNT=6;BYDAY=-2MO
ICAL

recurrence = Montrose::Recurrence.from_ical(ical)
recurrence.events.to_a
=> [1997-09-22 09:00:00 -0400,
 1997-10-20 09:00:00 -0400,
 1997-11-17 09:00:00 -0500,
 1997-12-22 09:00:00 -0500,
 1998-01-19 09:00:00 -0500,
 1998-02-16 09:00:00 -0500]

Partially addresses #26

This feature is missing support for "WKST", i.e. week start, and "SETPOS", i.e. nth instance of given weekday(s) within a month which will be considered future enhancements.

Enumerator#+ does not appear to be implemented in Ruby 2.5
deprecated use of global #must_ helpers; now wrap with _().must..
@rossta rossta merged commit bfe29bd into main Feb 7, 2021
@rossta rossta mentioned this pull request Oct 12, 2023
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.

1 participant