Hi allentownpublictheatre,
One of the sites that I manage uses this plugin, and they had the same problem. Ultimately, it boils down to the plugin not correctly handling timezones. Thankfully, the information that Google provides in their web service helps to automatically determine the timezone of your calendar.
Since the plugin developer hasn’t responded to your request in the last four months, I will explain how I fixed this on the site I manage. Below are instructions on what to do to fix this issue. Please be advised that modifying the source of a plugin like I am suggesting carries some risks with it, and should only be done if you are both comfortable with editing PHP code and also in control of the update-schedule for your website.
Fix instructions:
- Log in to your site
- Click on “Plugins” in the main admin menu
- Under “Simple Google Calendar Widget“, click on “Edit“
- In the list of Plugin Files (on the right side), make sure that “simple-google-calendar-widget/simple_gcal.php” is selected
- Lines 93-96 of the code should currently be this:
$out[$i]->title = (string)$e->title;
$out[$i]->from = strtotime((string)$when->startTime);
$out[$i]->to = strtotime((string)$when->endTime);
$out[$i]->where = (string)$where->valueString;
- REPLACE those lines of code with the following:
$out[$i]->title = (string)$e->title;
$resetTZ = date_default_timezone_get();
date_default_timezone_set('GMT');
preg_match('/^(.*?)(-\d+:\d+)?$/', (string)$when->startTime, $modifiedStartTime);
$out[$i]->from = strtotime($modifiedStartTime[1]);
preg_match('/^(.*?)(-\d+:\d+)?$/', (string)$when->endTime, $modifiedEndTime);
$out[$i]->to = strtotime($modifiedEndTime[1]);
date_default_timezone_set($resetTZ);
$out[$i]->where = (string)$where->valueString;
- The portion that was changed is in between the extra line breaks; the first and last lines remain unchanged, and I included them just to provide context
- Click the “Update File” button at the bottom of the page
- Now, your calendar’s events on your website should match the timezone configured for that specific calendar
Caveat: For each instance of the widget on your site, there is a “cache” limit specified (the setting is labeled “Cache expiration time in minutes:“). You will NOT see the changes that you just made take effect in any given widget instance until that cache limit has expired.
P.S. To the plugin developer: it would be really nice if you integrated this fix into your plugin, so that your customers would not have to do the fix themselves and risk missing later updates from you.