We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Problem, Addons, Events

Past Events are showing up on Perch Events Listing

Hi there - I've recently built an Events Calendar into a site, and wish to not have the past events showing in either my events listing or on the calendar. If you compare the calendar to the events listing, you'll see that past events are not showing up on the calendar, but they are showing up in the events listing.

Here's the site: http://www.draftkingswrigley.com/ - calendar is at the bottom of the site.

I'm using the 'past-events' => false in place as I think it should be used, but my past events are still showing up.

Here's the array I'm using on the page:


<?php perch_events_custom(array( 'match' => 'gte', 'value' => date('m-d-y'), 'count' => 5, 'sort' => 'eventDateTime', 'sort-order'=> 'desc', 'category' => array('home-games', 'wrigley-events'), 'past-events' => false, 'event-day-template' => 'templates/events/event.html' )); ?>

Here's the short diagnostics report from my Perch install...


Perch: 2.8.27, PHP: 5.4.16, MySQL: 5.5.44-MariaDB, with PDO Server OS: Linux, fpm-fcgi Installed apps: content (2.8.27), assets (2.8.27), categories (2.8.27), perch_blog (5.0), perch_events (1.9.2), perch_forms (1.8.3), perch_gallery (2.8.6), perch_twitter (3.5.1) App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_forms', 'perch_twitter', 'perch_gallery', 'perch_events', ); PERCH_LOGINPATH: /perch PERCH_PATH: /var/www/vhosts/draftkingswrigley.com/httpdocs/perch PERCH_CORE: /var/www/vhosts/draftkingswrigley.com/httpdocs/perch/core PERCH_RESFILEPATH: /var/www/vhosts/draftkingswrigley.com/httpdocs/perch/resources Image manipulation: GD PHP limits: Max upload 128M, Max POST 8M, Memory: 128M, Total max file upload: 8M F1: 2edba60ed1f613d6dd804feb202456a2 Resource folder writeable: Yes HTTP_HOST: www.draftkingswrigley.com DOCUMENT_ROOT: /var/www/vhosts/draftkingswrigley.com/httpdocs REQUEST_URI: /perch/core/settings/diagnostics/ SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

And in case you wanted it, here's the code on that event.html template...


<div class="vevent"> <h4 class="summary"><perch:events id="eventTitle" /></h4> <p class="dtstart"><span class="value-title" title="<perch:events id="eventDateTime" format="D, F j, Y g:i A" />"><perch:events id="eventDateTime" format="D, F j, Y g:i A" /></span></p> <div class="description"><perch:events id="eventDescHTML" type="textarea" textile="true" editor="markitup" encode="false" /></div> </div>

Please let me know if I can provide any other info, and thank you in advance for looking at this issue.

Gregg Tomlinson

Gregg Tomlinson 1 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Looks like you have your date in a jumble. Try:

'value'     => date('Y-m-d'),

Hmm... made that change, and it didn't work. Custom array now reads as follows, but the past events still show in the event listing on http://www.draftkingswrigley.com/


<?php perch_events_custom(array( 'match' => 'gte', 'value' => date('Y-m-d'), 'count' => 5, 'sort' => 'eventDateTime', 'sort-order'=> 'desc', 'category' => array('home-games', 'wrigley-events'), 'past-events' => false, 'event-day-template' => 'templates/events/event.html' )); ?>
Drew McLellan

Drew McLellan 2638 points
Perch Support

What happens if you remove the past-events option all together?

Hi Gregg / Drew

I had a similar thing happen on one of my sites previously and adding the following to the top of the array sorted it.

'filter'=>'eventDateTime',

@Drew - removing that past-events option did not work either, but thank you for looking at this for me!

@Neil - adding that 'filter'=>'eventDateTime' did in fact do the trick, so thank you for the suggestion and now my event listing beside the calendar is working correctly - woo hoo!

For the record, here's what that array looks like now...


<?php perch_events_custom(array( 'filter' => 'eventDateTime', 'match' => 'gte', 'value' => date('Y-m-d'), 'count' => 5, 'sort' => 'eventDateTime', 'sort-order'=> 'desc', 'category' => array('home-games', 'wrigley-events'), 'past-events' => false, 'event-day-template' => 'templates/events/event.html' )); ?>

Calendars are now working as needed, and can be seen running at: http://www.draftkingswrigley.com/ and http://www.haistreetkitchen.com/food-truck/about - thank you again for the assistance!