4 ms·
Nice. Thanks. Should be fixed now. I kept thinking that I should disable being able to toggle days after today because it did not provide any utility. It could
by brett 19y ago
Nice. Thanks. Should be fixed now.
I kept thinking that I should disable being able to toggle days after today because it did not provide any utility. It could have helped out in this case.
- bootload 19y ago"... Nice. Thanks. Should be fixed now. ..." Thanks brett, checked it, works. "... I kept thinking that I should disable being able to toggle days after today because it did not provide any utility ..." so I shouldn't have been able to click the days after today? Oh also found another PIA which is going to require a bit of a login detail. I'm Aus and close to the date line. Today, now is 2007AUG241154 meaning I'm working yesterday. Any chance of making the default time format GMT, UTC ? Should allow everyone to be on the same page OR you'll have to (probably have to anyway) modify users time by selecting location then adjusting the date-time to the user location.
- brett 19y ago"so I shouldn't have been able to click the days after today?" No, I did not get to that. I just fixed it so that if all the days you've clicked are after today (PST) then it does not try to calculate the streak of days between today and the beginning of time. And yeah, I was just lazy to not include timezones. I should fix that.
- euccastro 19y agoI have no idea if this is possible, but what about trying to read the timezone settings in the host computer with Javascript, rather than asking the user to set that?
- bootload 19y ago"... 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.
- brett 19y agoOkay. 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.