u01jmg3 / ics-parser

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

Fix bug with COUNT in conjunction with EXDATE. COUNT should include e… #263

Closed lucianholt97 closed 4 years ago

lucianholt97 commented 4 years ago

…xcluded dates.

Now incrementing counter outside of isExcluded check. Added new test and fixed existing test data

closes #262

u01jmg3 commented 4 years ago

@s0600204: would welcome your input on this

s0600204 commented 4 years ago

Sure:

Personally I'd have thought that if the RRULE states a COUNT of 5, then 5 event instances should be spat out at the end.

However it appears I'm wrong - page 199 of the rfc5545 spec states:

[...] The final recurrence set is generated by gathering all of the start DATE-TIME values generated by any of the specified "RRULE" and "RDATE" properties, and then excluding any start DATE-TIME values specified by "EXDATE" properties. [...]

The PR conforms with the spec, is logically sound, and passes the tests. Go for it.


(The grammar-pedant in me says: within the new comment, replace "also" with "including", and capitalise the first word.)

u01jmg3 commented 4 years ago

The grammar-pedant in me says: within the new comment, replace "also" with "including", and capitalise the first word.

See c8dbf16