OzzyCzech / icalparser

Simple ical parser for PHP
https://ozana.cz
BSD 3-Clause "New" or "Revised" License
59 stars 22 forks source link

Weekly recurring event on specific days missing first day of event #38

Closed nickcoons closed 5 years ago

nickcoons commented 5 years ago

We have an iCal file generated from Google Calendar that we're parsing. It has multiple events that are recurring weekly on Mondays, Tuesdays, Wednesdays, and Thursdays. When the recurring event is parsed, the first week parses correctly. But for all subsequent weeks, Mondays are omitted.

I enabled debugging in the function that locates the next occurrence of an event and it looks like after the event on Wednesday, the EOP (end of period) value was being set to the following Monday but at midnight, so the event on Monday was out of the scope. When it continued in the loop, it began with Tuesday, so no Monday (other than the first Monday) was included in the list of recurrences.

The solution that we employed was this:

Changed line 367 in /opt/calendar/vendor/om/icalparser/src/Freq.php to read return $this->findStartingPoint($offset, 1, false);

Original value was: return $this->findStartingPoint($offset, 1);

I have no idea if that was the correct way to resolve it, or if this should be introduced as something permanent to the code base. But it's working for our specific situation.

corradomella commented 5 years ago

I can confirm that the above corrects the error.

Please update the code.

Rotzbua commented 5 years ago

Please update the code.

Make a pull request?....

tm1000 commented 5 years ago

@Rotzbua I did the work and also added unit tests.

tm1000 commented 5 years ago

6 days later and no merge.