Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gaelgerard opened this issue Jul 20, 2022 · 1 comment
Open

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

gaelgerard opened this issue Jul 20, 2022 · 1 comment

Comments

@gaelgerard
Copy link

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant