simshaun / recurr

PHP library for working with recurrence rules (RRULE); meant to help with recurring calendar events.
Other
1.21k stars 135 forks source link

RFC compliance and fixes for issue #137 #180

Open ftcvlad opened 4 years ago

ftcvlad commented 4 years ago

This PR fixes #137 (bugs 1 and 3). 'DTEND not predictable' mentioned in #137 happens because DTEND from rrule string takes precedence over the one set by parameter. This is not changed.

Bug 1: recurr does not parse rrule string correctly if the string has TZID. At the same time when converting Rule to string recurr is able to output TZID. Bug 2: When converting Rule to string, recurr outputs 'DTSTART=', which RFC 5545 doesnt allow, and which recurr is not able to correctly parse

1) Test Recurr is able to parse the string created by itself 2) Fix parsing for the test to pass

Bug 3: If endDate is passed as DateTimeImmutable it is not applied to the produced rrule string because the check is instanceOf DateTime. Check for DateTimeInterface

DTSTART, DTEND and TZID from rrule string take precedence over constructor parameters

dereuromark commented 3 years ago

This looks quite useful. Is this library still maintained or did someone fork it?

romansidorov commented 2 years ago

@simshaun Hi, could you please make a merge?