Google Calendar Events
display bygone events separately (3 posts)

  1. Alex
    Posted 4 years ago #

    Hey there,
    I want to display all bygone events (not just these of this month) in an separated list on a page. So I want a "upcoming events" and a "bygone events" list.

    By changing line 36 in plugin/google-calendar-events/inc/gce-parser.php
    $feed->set_start_date(mktime(0, 0, 0, date('m'), 1, date('Y')));
    $feed->set_start_date(mktime(0, 0, 0, 01, 1, 2009));
    I get all events displayed.
    Now i need to add a new Shortcode which just displays bygone and a shortcode which just displayes upcoming events. Any Idea how to do that?


  2. Alex
    Posted 4 years ago #

    Ok. Just found a resolution by jusing 2 calendars with the same feed. One time "Retrieve past events for current month?" enabled, the other time disabled.
    @ plugin-author: maybe you can include smth like this in the next update?

    My code:

    plugin/google-calendar-events/inc/gce-parser.php line 35 ..

    if($feed_options['show_past_events'] == 'true'){
    	$feed->set_end_date(mktime(0, 0, 0, date('n'), date('j'), date('Y'))); // added
    	$feed->set_start_date(mktime(0, 0, 0, 01, 1, 2009)); // was $feed->set_start_date(mktime(0, 0, 0, date('m'), 1, date('Y')));
    	$feed->set_start_date(mktime(0, 0, 0, date('m'), date('j'), date('Y')));

    It is not a clean solution because it misuses the "Retrieve past events for current month?" - feature. But you could add a third feature "display only past events" :)

  3. Ross Hanney
    Plugin Contributor

    Posted 4 years ago #


    I just replied to your email (sorry for the delay!), and yes, I'll look into adding something like this into the plugin in the future. A few people have asked for a similar type of thing now.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Google Calendar Events
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic