Google Calendar Events, 0.4

I haven’t had much response (or any, really) to my beta release of 0.4, so I think the best thing to do is release it and be prepared to fix a few issues, if necessary, as and when they arise. I have done quite a lot of testing and everything seems to be ok, but it’s difficult to anticipate some potential problems, especially those to do with i18n and timezones.

0.4 adds quite a few small-ish features that people have asked for, or that fix certain problems. Here’s an explanation of the various bits and bobs:

More Control Over Display of Start and End Dates / Times

In previous versions you were stuck to displaying a time only for the start date, and end dates had to be displayed with a date and time.

Options have now been added so that you can display any combination of time and date for both start and end. You can also customize the separator text, so all of the following formats are possible (amongst many others):

  • 19th August 2010, 12:34pm
  • 12:34pm – 19th August 2010
  • 12:34pm on 19th August 2010
  • 19th August 2010 at 12:34pm

Of course, the dates / times themselves can be formatted in any way you require (this has always been possible in the plugin)

Limit Events to Specific Number of Days

There’s now an option in the settings for each feed to specify a maximum number of days to retrieve events for, starting from 12:00am ‘today’ (Thanks to Harald Solheim for this idea).

The ‘maximum number of events to retrieve’ setting still applies even if you have entered a day limit. Events will be retrieved up to the limit that occurs first.

Events in Lists Grouped by Date

Events in lists that occur on the same day can now be grouped under one date heading. To enable this in a widget, select ‘List – grouped by date’ from the drop-down box in the widget settings. In a shortcode, use type="list-grouped", like this:

[google-calendar-events id="1" type="list-grouped"]

A date title will always be displayed in a grouped list, regardless of whether you chosen not to display one in the shortcode / widget settings (A list grouped by date without the date shown makes little sense).

Add JavaScript to the Footer

A large number of the problems that people have had with the plugin have been to do with JavaScript conflicts. It seems that many themes do not enqueue their JS files, preferring to just output them as the last thing before </head>. If one of these files is jQuery (very common) then the plugin JS encounters errors.

To get around this, there is now an option, which when selected, will cause the plugin JavaScript files to be output to the footer rather than the header. In the majority of cases, this should avoid the problem.

Loading Text Customization

You can now specify the text to be displayed when the calendar grid data is loading during a AJAX request. The default is ‘Loading…’.

Limit Description to Number of Words

In the settings for each feed, you can now specify a maximum number of words of the description to display. This can prevent tooltips from becoming huge if you have lengthy descriptions.

Show a Multi-Day Events on each Day it Spans

Another option in the feed settings allows the display of multi-day events on each day that they span. The current behaviour is just to show multi-day events on the first day that they occur.

Note: I’m not sure if the below limitations even apply any longer as of 0.6. I need to do some testing to make sure!

This feature has some limitations, due to the fact that the calendar feed data from Google only has one entry for events, regardless of how many days they span. My plugin uses the end date / time from the feed data to calculate which additional days to show the event on. However, if the start date / time of the multi-day event has passed (but not the end date / time) and ‘Retrieve past events…’ is set to false, then event will not exist in the feed data, so the plugin can’t add it to the remaining days. Did that make sense? Probably not. Here’s an example:

Today is August 19th. I have an event in my calendar that started on August 17th and ends on August 20th. In the plugin, I set ‘Show past events…’ to false, meaning that events will be retrieved from 12:00am today onwards. The feed data retrieved from Google does not contain the multi-day event, as the start date is before the time at which to begin retrieving events. As far as the plugin is concerned, the event doesn’t exist, so it can’t add it to the appropriate days.

This issue also occurs at the boundary between the previous month and the current month, regardless of whether ‘Retrieve past events…’ is set or not.

I don’t believe that there is any way around this issue without retrieving large amounts of potentially unneccesary feed data, or adding a huge amount of extra complexity to the plugin, neither of which I’m particularly keen to do. I’ll keep investigating anyway, there may be some way of solving this that I haven’t considered.

Basically, don’t rely on this feature being 100% accurate.

You can download the plugin from the WordPress plugin directory, or update automatically from within your WordPress admin.

If you’re looking for help, want to report a bug or have a suggestion for a feature, please leave a comment on this post, or on the plugin homepage, or contact me.

Thanks! :)

96 Responses

  1. Hi Ross!

    Thanks again for such a good plugin! Labour of love, obviously!

    I’ve been struggling to find where I can edit the layout of the widget list… I need the start date to be above the event title, but looking through the plugin files I can’t find any occurrence of “gce-list-start”.

    Are you able to point me in the right direction? I’m guessing it is only a case of switching the two about in one of the plugin files at least…


    1. Actually… scratch that. We have bodged it together by floating the s and simply moved them about with margins instead. Easier than editing the PHP for a novice like me!

      1. I’m trying to do something similar, but with an inline list. Basically I need this format:
        Jan 28, 6pm Art show at the gallery
        Feb 12, 11am Lunch with the editors
        I had this set up in the previous version of the plug-in, but unfortunately that css was lost when I updated the plug-in. I think I managed it before by re-arranging a few lines in the gce-parcer.php, but can not replicate this now.
        Can you help me out with a css solution for this? the floats aren’t working great since the tag for the date follows the tag for the event name, which in my situation sometimes takes up a few lines.


  2. I’d like to add on and say thanks for the great plugin, it is a league above the rest. Is there a command to show Calendar grid on a wordpress page?

    also, manually controlling number of events to display in widget would be great.

    Thanks for your work and effort

    1. I think you can do that already, can’t you? In the feed (Settings > Google Calendar Events ) you can set the number of events to retrieve… I normally set mine to 5 events for a sidebar feed.

  3. Thanks for such a terrific plug-in; it was a surprise and a relief and a pleasure to discover.

    Quick question – my Google calendar correctly shows the date as Saturday because I am in New York, and it is 9:26 pm. But on the sidebar widget for the plug-in, it is greying out Sunday already. Does the grey-out indicate current date? If so, where is that timezone controlled? I have tried setting the timezone to New York in the plug-in settings, but it is still showing tomorrow as the current date.

    Also, there is no indication of the current date in the grid/ajax display on the page. Is there a way to modify the code so it will indicate the current day on the calendar?

    Thanks so much for any guidance!

    1. UNLESS the grey-out just indicates the next event coming up on the calendar rather than the current date?

  4. Trying to add the plug in, but I’m getting this error:

    Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/content/s/p/r/springcart/html/blackgirlsride/wp-content/plugins/google-calendar-events/inc/gce-parser.php on line 108

    Any idea how to fix it?

  5. Hi:

    This is a great plug-in, but I was wondering why there is the limitation to retrieve events only as far back as the beginning of the current month? I would really like to use the calendar to schedule our bike club rides – this is very easy to do in Google Calendar. For instance our Thursday Night ride is just one entry – starts first week in April and I set it to repeat every Thursday until September. However, it looks like once I get past April the calendar is no longer going to retrieve the event? Is this true? Any way to overide it?



  6. Hello Ross!

    Your plugin is great!

    I know that you have a lot of sugestions, but I think this is easy to do. I want to select what day of the week my calendar starts, like starting the week on Sunday, not in Monday… I didn’t find this function on your plugin, so I decide send this suggestion. I try to configure it at the google calendar account, in xml sharing, but I can’t find it..

    Other suggestion is to show on the large calendar, the titles of events on the calendar grid, not show only by tooltip when mouse hover in it. Show like google calendar does. Tooltip is great for widget, but for large calendar I think that can have choices to show tooltips, title events, or both on the grid..

    Sorry for my english!
    Marcelo Vetter

  7. Ross,

    Thanks again for this superb plugin. This Google Calendar Events 0.4 just helped me solve my second puzzle, the time zone in WP issue. Problem solved by your response to dmitcha above. Thanks!



  8. I have a small problem with this (otherwise great!) plugin.

    For multi-day events, the [end-date] is always one day later than the actual end date. Perhaps this is because Google Calendar stores the end-time as 00:00 (technically the start of the next day).

    Is there a way around this?

  9. Hi, :) I am trying to implement it and so happy with it (no Google icons etc)
    How can i set : show start time and end time if not a full day event?

    Now its shows start date and enddate: full day is enddate 00:00 new day

  10. Hi – a big thumbs up for a great plugin! I have a library site i am building with a calendar that has up to 5 events on a single day. When i use the calendar view, it is only showing the one event that is going on for two weeks and is a full day event listing. All the other listings on a particular day that are a specific time are not showing. Any ideas?
    Thanks in advance!

  11. Hi Ross,

    Brilliant plugin! Thank you so much for developing it.
    I wondered whether there would be a way to display each event as a vertically scrolling ‘news ticker’, so that each event is displayed one at a time. Basically, I want to display all the upcoming events in a week as a widget at the top of the front page of our school website, but there are often a lot of events (so the full list is too big), so I have to just show the next 5/6 events to make the list a reasonable size. A scrolling ticker to display the list of events one by one would solve both the size and number of events issues.
    Any suggestions?

    Many thanks,

  12. I was wondering how hard it would be to make it so that events are grouped by month. For example:

    -event 1
    -event 2
    -event 1
    -event 2
    -event 1
    -event 2


  13. Hi,

    I want my list to show the next 7 days and all the events that are held on those next seven days. How do I do this? I have read your notes and it looks like it can be done but I am not sure how to do it.

    Thank you in advance for your help! Much appreciated!