3 ms·
Okay. It should now pick up your timezone via js. Unfortunately right now you won't notice it until the second request. I could have js refresh the page when it
by brett 19y ago
Okay. It should now pick up your timezone via js. Unfortunately right now you won't notice it until the second request. I could have js refresh the page when it detects that the tz needs to be set/changed, but I don't want to do that until I am totally certain it cannot end up in an infinite refresh loop.
- bootload 19y ago"... The big PIA is time-syncing in with where you are at the moment ..." Though I was thinking this fails if your machine has the wrong time. "... It should now pick up your timezone via js ..." and you can use this to check against user preferences in TZ. I'll be checking the src how you do this. Difficult to find out how?
- brett 19y agoJSTZ_OFFSET gets set by the backend from the session: var offset = new Date().getTimezoneOffset() / 60 if(offset != parseInt(JSTZ_OFFSET)){ new Ajax.Request("/jstz/" + offset); }
- bootload 19y agothanks for the code sample. didn't know JS had a date object. then again there are lot of things I don't know ...
- euccastro 19y agoIf I understand it right, you are sending the timezone info back to the server? If so, why does the server need to know at all? Just use that info to set the background of the 'today' calendar cell in the client side.
- brett 19y agoTo determine which range of dates gets shown and to calculate the number of days in your current streak. I guess could do the latter on the client, but what if it's Aug 31st in CA and Sept 1st in MA and the user is in month view? I'm not yet ready to go all js.