Hacker News new | past | comments | ask | show | jobs | submit login

"... I have no idea if this is possible, ..."

Either do I but it would be just as easy to add a login, select timezone & store that, but then if you take a plane from foo to bar and your zones change you have to change it again.

This is a good idea btw. And I have looked at calendar apps in the past. The big PIA is time-syncing in with where you are at the moment.




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.


"... 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?


JSTZ_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);
 }



thanks for the code sample. didn't know JS had a date object. then again there are lot of things I don't know ...


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


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: