Forum

Thread tagged as: Question, Events

Filter past events - perch_events_custom

Hi there,

As I haven't found any related answer to my problem I dared to post this call for help.

I'm using perch_events_custom to display my events:

perch_events_custom(array(
    'template'=>'events/listing/custom-listing.html',
    'sort'=>'eventDateTime',
     'sort-order'=>'ASC',
     'count'=>3
));

How can I adapt the code so it only shows future events? I guess that some sort of match/filter combination needs to be used?

PS: It would be even better If I could also add a CSS class to all the past events..

Cheers! Damian

Damian Drozdowicz

Damian Drozdowicz 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You can filter for dates greater than today.

'filter' => 'eventDateTIme',
'match' => 'gte',
'value' => date('Y-m-d H:i:s'),