Little error in the Filtering Compendium

OK, while I’m at it, after scratching my bald skull, I finally managed to filter the “current event” in my Events page ! But there is an error here : https://getkirby.com/docs/cookbook/filtering#fun-with-filtering-by-date
In the custom date fields paragraph, to fetch all events that are happening right now you have to type:
->filter(function($child) {
return $child->date(null, ‘startdate’) < time() && $child->date(null, ‘enddate’) > time();
});
so that the startdate is smaller than time and the enddate greater than time, which makes more sense.
Phew. Maybe it can help someone. By the way, Kirby is awesome. :slight_smile:
Cheers,
Daniel

That’s correct, thanks. In the future, could you please post such issues in the getkirby.com repo?

Fixed in the repo.

I certainly will!
Good night and sweet dreams everybody…

1 Like