I have the gCal module installed and the block displayed.

PROBLEM:
The times of the events as they appear in the block are correct; however, when you click on the event hyperlink in that block and get the event details opening (lets call this the 'events details view', the url starts: http: //www.google.com/calendar/event?eid=bj... etc), the times are one hour behind (minus 1 hour)?

So, for example, an event as created in Google Calendar is 2pm and the time is correctly displayed as 2pm in the block. But clicking through from the hyperlink in the block (to the 'events details view') and the resulting display says 1pm!!

Now, the only variation to this is if I happen to be logged into the Google calendar at the time on my PC, clicking on the hyperlink in the block will get the 'events details view' opening with the correct time displaying.

The problem only occurs when clicking the event hyperlink in the block. So, while I also have the Google calendar embedded on a page on the site, clicking on the event hyperlink from within the calendar leads to the same page ('events details view') but with the correct time showing.

Additional Info:
I have the correct time zone, etc. set in Google calendar and in the gCal module.
Using Drupal 6.9
Using gCal 6.x-1.4
gCal cache directory box left blank (no caching, which seemingly is not recommended, but I have had other problem here if I enter cache directory, SEE http://drupal.org/node/383492)

The problem can be seen here - http://dublinonecityonebook.ie (gCal block is on the left)

Any ideas? I have searched high and low and cannot figure it out. Despairing!
Thanks in advance.
Ed

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Se7enLC’s picture

Now that's an odd one. The times are showing up as correct when looking at the google calendar, and showing up correctly in the block, but NOT showing up correctly when you click on the event link from the block? I'm seeing the same thing when looking at your link, except I am seeing it as 5 hours off.

This looks like a google bug, as the only thing this module does is take the URL from the feed and make it into a clickable link - the contents of that URL are generated by google, and if the times look correct in the google interface, I don't know what to tell you.

It looks like a timezone thing. Perhaps the calendar is set to use one timezone in google and a different one in drupal? Maybe this is not a bug at all, but bizarre intentional behavior on google's part - I see the calendar as 5 hours off, which I think would make it correct for local time in EST, which is where I am.

What is the calendar ID for that calendar?

ebyrne41’s picture

oiukd7nk9d9cvkqo17rb437jl8@group.calendar.google.com

I have the time zones set as the same in Google Calendar [(GMT+00:00) Dublin] and gCal Timezone [Europe/Dublin]

thanks, Ed

Se7enLC’s picture

I think I found the source of the problem.

When displaying that events detail view, Google uses the selected timezone of the currently logged-in google user. In my case, it was set to EST, so I was seeing Bram Stoker's Wedding at 1pm instead of 6pm (since it would be 1pm in EST). When I changed my timezone in google calendar to be Dublin time, I saw the correct timezone in that detail view (6pm).

When I logged out of Google, however, I saw the default timezone, which was GMT, putting the wedding at 5pm. I would think that a more appropriate default time would be the timezone specified by the calendar. This is a google bug, or perhaps it is intentional. In any case, there is nothing that gcal events can do to fix it, apart from making that detailed event view no longer a clickable link.

In the process of looking into this, I also uncovered another bug where if you select "today only" in a timezone that is GMT+, it will not show any events. I believe this is because the plus sign is being treated as a space by google, and the start time will be invalid. I don't think that is related to what we are seeing, however.

Se7enLC’s picture

And now I think I have a possible fix. By appending "&ctz=Europe/Dublin" to the individual URLs, I can force it to display in a particular timezone. For now, try adding that into the template to see if that fixes it. I will add that into the next release so that it uses the correct timezone.

ebyrne41’s picture

When I logged out of Google, however, I saw the default timezone, which was GMT, putting the wedding at 5pm. I would think that a more appropriate default time would be the timezone specified by the calendar.

I don't quite follow you here. Are you referring to the default time set (by me) in the Google Calendar and the gCal module? Because I have set the default as the same in both Google Calendar [(GMT+00:00) Dublin] and gCal Timezone [Europe/Dublin] - they are both the same time zone. So I should be seeing 5pm regardless, I would think. Or are you saying there is nothing I can do about it? I can remove the hyperlink of course, but doesn't that defeat the purpose where I need to link to the fuller information? If that is removed, the module loses a lot.

Maybe I am not understanding correctly?

ebyrne41’s picture

sorry, didn't see your last reply, will study this and address later at home, have to leave the office now. Thanks for your help, I hope we get this sorted.

ebyrne41’s picture

That did the trick! I can see now what the problem was.

Appended as follows:
"#URL#&ctz=Europe/Dublin"
whereas before it read
"#URL#"

Thanks a mill! It will be a worthy addition to the next release if you can incorporate it. Great module.
Cheers, Ed

ebyrne41’s picture

Status: Active » Closed (fixed)
mickster917’s picture

Status: Closed (fixed) » Active

I'm having this same issue. I've tried customizing the information you provided above to my time zone but cannot seem to get it to work. I'm in Eastern Time (US). Can you please help me with this? I love the module, but cannot utilize it until I work out this bug. Thanks.

jdwfly’s picture

Category: support » bug

Changing to bug report and bumping to 7.x since I'm pretty sure it would affect that version as well.

jdwfly’s picture

Title: Times out by one hour » Timezone issues based on currently logged in google account
Version: 6.x-1.4 » 7.x-1.x-dev
MEEfO’s picture

Wow so ends several hours of headache. I hadn't thought to check gCal bug reports because it was clear it was an issue with Google Calendar itself. There are bug reports on this issue going back to 2009 on Google's forums with no helpful solutions. Thanks for the workaround, I appended &ctz=America/Chicago to #URL# and now logged-out users see the correct timezone. Ridiculous.

  • jdwfly committed c5557ce on 7.x-1.x
    Issue #421684 by jdwfly: fixed handling of timezones on calendars.
    
jdwfly’s picture

Status: Active » Fixed

For those of you that used the workaround, you will need to remove that as it is automatically added in the code now.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

guschilds’s picture

Any reason why this same commit wasn't made to the 6.x-1.x branch? Attached is the equivalent patch. Thanks!

Reena Buthello’s picture

Assume I had set the start time of an event named "party" to 2 AM (GMT-05:00) EST, In my website if I click on the event name "party", It will redirect to a page where the event details is displayed. If a user is LOGGED IN to his gmail, then the event start time is shown as 2 AM. If a user is LOGGED OUT from his gmail account, the event's start time is shown as 7 AM. ie., 5 hours ahead of the EST. Could you please let me know how to fix this issue?

chriscalip’s picture

In response to comment #16 , the reason why is neither branches 7.x nor 6.x have any array_push code . Your patch is only applicable to master branch.