Jump to content

Timezones drives me crazy :(


Sonya*

Recommended Posts

Posted

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:

Posted

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.

Posted
3 hours ago, bfarber said:

Are you using a custom theme?

Yes, it's Novus and Dimensions from @Ehren and the block for upcoming events is made with SuperBlock from @opentype. I will check if there are javascript errors and also recheck if the issue persists on the default theme as well.

Posted
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?

Posted

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).

Posted

Could we consider displaying the raw time in all cases (server time or UTC) in the cached page in all cases, knowing that the JavaScript will corrected for those that have JavaScript enabled?

That way it's consistent and we know what things reading the page without JavaScript will see.

Posted

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).

  • 2 weeks later...
Posted

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. 

Archived

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

  • Recently Browsing   0 members

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