Jump to content

Timezones drives me crazy :(


Sonya*

Recommended Posts

I have a calendar block (Upcoming events) on the start page. Whenever I look at the block as guest I see different times for my events. Note: I use Chrome or Firefox browsers with the same language and I do not leave my location. Example, event starts at 7:00 at the morning local time. Yesterday as I have shown the page to my friend on his tablet and there was suddenly 6:00 for the event. All other events had the time shifted by one hour as well. I have searched for the error about 5 minutes and wanted to file support request as suddenly the times were corrected.

Today morning I see the same behaviour. All times are shifted for guests (checked in Chrome and Firefox) on two different devices. When I log in then the time is correct. I have purged the cache wit support tool and everything is OK now.

I assume that the blocks are cached on the start page for guests. If the guest has a time shift then the block is cached with his (guest's) timezone and then all the guests see the events in block with this "false" time till the cache is renewed. Is it possible? :sad:

Link to comment
Share on other sites

Are you using a custom theme?

Because blocks indeed cache based on the viewing user, we have javascript in place designed to "correct" the time for the current viewing user. If you have modified your theme or have any javascript errors, this behavior may not be working as expected.

Link to comment
Share on other sites

4 hours ago, bfarber said:

Because blocks indeed cache based on the viewing user, we have javascript in place designed to "correct" the time for the current viewing user.

How is the time that is cached determined? Are they consistent (i.e. all in UTC or server timezone) or are they whatever the user initiating the cache happened to have set?

Link to comment
Share on other sites

The HTML that is cached would be dependent upon the viewing user's time zone, however as I said there is a javascript module that then adjusts the time that is displayed when the block loads into the page based upon the current viewing user's time (the raw time is stored in an HTML attribute).

Link to comment
Share on other sites

You are free to post that as a suggestion in the feedback forum, however given the complexity to do that vs the "reward" or payoff in making such a change, I don't know that we'll rush to dedicate development time to such a change. Any computer programs (i.e. bots) reading the page can already read the raw time as it is marked up appropriately, and our general approach to users who disable javascript is to ensure the site generally works, but some specific things may not be available (such as this).

Link to comment
Share on other sites

  • 2 weeks later...

Unfortunately the issue is still not solved. It is not a theme issue though. I have the issue on two different projects. One uses a theme from @Ehren, another a theme from @TAMAN. I have a shift of one hour, not only in events but in new topics block as well. Switching to default theme does not change anything. The times swing one hour back and ahead. In forum and calendar itself the times are correct. It seems only affect the times in blocks. I will watch it further. 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...