Wednesday, 9 May 2007

Bug: Current date/time should be in user's time zone (if known)

Added code to process the \verb+HDiet_tzoffset+ variable set by the JavaScript code to the user's local timezone offset with GMT. This code sets variables at the transaction global level which contain the local time (in Unix time format), and the civil wall clock time at the user's site. All direct links between pages now propagate this variable along with the session ID, so that any page which requires it should have access to this value. Note that if the user does not have JavaScript enabled or the has a ridiculous time zone setting, \verb+HDiet_tzoffset+ will be set to ``{\tt unknown}'' and the local time variables will be set to UTC.

Changed all instances in which a UTC date was used to decide what to display (for example, the current month's log immediately after a sign in) to use the date in the user's time zone as determined above. This fixes the problem where, for example, a log is displayed for the the first day of a month while, in the user's time zone, it is still the last day of the previous month. (Reported by Robert Ewing.)

No comments: