u01jmg3 / ics-parser

Parser for iCalendar Events • PHP 8+, 7 (≥ 7.4), 5 (≥ 5.6)
MIT License
448 stars 144 forks source link

Implement more YEARLY RRULE stanza options #271

Closed s0600204 closed 3 years ago

s0600204 commented 3 years ago

The changes encapsulated within this PR add support for the BYYEARDAY, BYWEEKNO and BYSETPOS recurrence rule stanzas - and expands on the existing BYDAY stanza support - when any of these are used with the YEARLY frequency.

Also included are relevant tests.

After this PR, only BYMONTHDAY[^1] and the time-based stanzas (BYHOUR, BYMINUTE, BYSECOND) are not supported under YEARLY.

Refs. #11


[^1] - A future PR for this is in the works, but touches more than just YEARLY.

u01jmg3 commented 3 years ago

Thanks for this addition and I appreciate the rundown on how to interpret the spec.

Happy for you to be named on the list of contributors if you want to be added :)

u01jmg3 commented 3 years ago

@s0600204: can you comment on support for BYWEEKDAY?

s0600204 commented 3 years ago

Happy for you to be named on the list of contributors if you want to be added :)

Sure.

Can you comment on support for BYWEEKDAY?

BYWEEKDAY isn't part of the RFC5545 spec, it appears to be an alias (of sorts) for BYDAY that jakubroztocil's rrule.js (and the python-dateutil python module it's based on) uses.

The usage example in the README for rrule.js shows a byweekday property being passed to the RRule constructor, and when the .toString() method is called on the created object, it has been translated to a BYDAY. Similarly, it appears that a BYDAY within the RRULE of an event is made available on the byweekday property when parsed by either of those parsers.