Forum

Thread tagged as: Events

Events Custom Listing

Hi,

I'm trying to display a list of forthcoming events between two dates for example, all events between today and three months from now.

Is it possible to do this without manually updating the code?

I have had a go but without much luck - see below

<?php  
$date = date('Y-m-d');
$newdate = strtotime ( '+3 month' , strtotime ( $date ) ) ;
$newdate = date ( 'Y-m-d' , $newdate );

    perch_events_custom(array(
        'filter'=>'eventDateTime',
        'match'=>'eqbetween',
        'value'=> $date, $newdate,
        'sort'=>'eventDateTime',
        'sort-order'=>'DESC',
        'template'=>'listing/custom-listing-day.html'
        ));?>

Any help is really appreciated,

Thank you

Theodore Wilkins

Theodore Wilkins 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Sure:

    $date = date('Y-m-d');
    $newdate = date('Y-m-d', strtotime('+3 months'));

    perch_events_custom(array(
        'filter'=>'eventDateTime',
        'match'=>'eqbetween',
        'value'=> $date.', '.$newdate,
        'sort'=>'eventDateTime',
        'sort-order'=>'DESC',
        'template'=>'listing/custom-listing-day.html'
        ));