GDN_User.HourOffset being overwritten

I have a weird thing going on.
I have my HourOffset in mysql set to -7.
I will go into mysql and change GDN_User.HourOffset to 0. Then I'll refresh the Vanilla page, and the '0' is in effect.
Howerver as soon as the page is refreshed, the mysql database gets overwritten back to -7.
Is there something being saved somewhere that forces this automatic overwrite? It will happen every single time.
You can see my mysql session prior to refreshing the vanilla page, it remains at 0 until I do something with vanilla
mysql> UPDATE vanilla2.GDN_User SET HourOffset = 0 WHERE GDN_User.UserID =2; Query OK, 1 row affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0
mysql> select HourOffset from GDN_User where UserID=2; +------------+ | HourOffset | +------------+ | 0 | +------------+ 1 row in set (0.01 sec)
select again after a few seconds, still set to 0
mysql> select HourOffset from GDN_User where UserID=2; +------------+ | HourOffset | +------------+ | 0 | +------------+ 1 row in set (0.00 sec)
Now as soon as I refresh the vanilla page:
mysql> select HourOffset from GDN_User where UserID=2; +------------+ | HourOffset | +------------+ | -7 | +------------+ 1 row in set (0.00 sec)
Answers
BTW this is vanilla 2.1
Your current hour offset is automatically calculated locally in JS every page visit. If the local calculation doesn't match the server stored offset (which you can see in the #Definitions element), it triggers an update to the currently logged in user.
You should solve this problem by setting the server timezone according to your preference.
You can disable the automatic hour offset functionality by commenting out the relevant code in your
/js/global.js
file (lines 1147-1154).Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
great, I'll take a look and try it out. The forum's timezone is meant to be different than the server, so that's why I'd like it not to automatically reset
thank you
Thanks.
I commented this out in js/global.js and it seems to work:
However, I found it starting at line 32 in the file, not around 1147.
Glad you found it!
I don't know how I made that mistake. :S
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.