OzzyCzech / icalparser

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

Uncaught Error: Call to a member function sorted() on array #63

Open gaelgerard opened 2 years ago

gaelgerard commented 2 years ago

Hi,

When I use the foreach loop as described in the doc, I get that fatal Error

foreach ($cal->getEvents()->sorted() as $event) {

Uncaught Error: Call to a member function sorted() on array

If I remove the sorted part, the script is working but it seems there are confusions in the event Dates

foreach ($cal->getEvents() as $event) { My php version is 7.4.27 and installed icalparser via composer this week.

What could I have missed?

Thank you for your Help!

gaelgerard commented 2 years ago

Update: There is no confusion in the Events dates while ->sorted() part of script is missing.

I had an error with the timezone and the All Day events.

I keep this issue opened as I'm curious to know what this ->sorted() part of script is for and eventually use it without the Error.