Hi there,
My goal here is to filter events by multiple dates. Some of my events have recurring dates, which means that any of the following fields could be defined by the panel user:
end_date
addl_end_date1
addl_end_date2
addl_end_date3
I want to initially sort by end_date then cycle through the additional dates. For example, if end_date is in the past, then the filter automatically filters that out and then searches for the next available date that is in the future. Here’s what I thought might work:
$event = page('events') ->children() ->visible() ->filter(function($child) { return $child->date(null, 'end_date') >= time() || $child->date(null, 'addl_end_date1') >= time() || $child->date(null, 'addl_end_date2') >= time() || $child->date(null, 'addl_end_date3') >= time(); });
I looked at this: Filtering by Date, but the way the filter above is set up, every single event is filtered out, regardless of date. Has anyone filtered their events using multiple future dates? Any ideas?
Thanks, all!
But now that the events are filtered, I want to arrange / sort them by the next future date they have- if they are still displaying but their event date is past, I want them to appear first.
