Integration with Google Calendar necessitated producing UTC time (in
RFC 3339 format
http://www.ietf.org/rfc/rfc3339.txt). Since Calagator
stores times in Portland time I added an ugly booger to the
event_helper that converts Portland time to UTC.
I researched timezone conversion a bit but it just seemed too tedious
and annoying. Instead I just hard-coded the routine to convert from
Pacific Daylight Time for now. So it'll work until we "Fall" back. And
then it'll work again in Spring '09.
A better fix would be to store all our DateTime's as UTC internally.
That would entail adjusting them every place we export or display. I
think most Web Services (like Google Calendar) operate on UTC so
things get easier there. Dunno if this'll cause extra annoyance for
iCal though.
On the web rendering side I recommend putting UTC's into the pages.
That way we don't have to know the user's UTC at all (and hence we
don't need profiles and logins). Instead we can convert the UTC's to
local-adjusted datetimes in the page with this JavaScript routine:
function LocalizeDateTime( e) {
if( e.firstChild) {
var d = new Date( Date.parse( e.firstChild.nodeValue));
e.firstChild.nodeValue = d.toLocaleDateString();
}
/* input fields don't have child content -- value is in "value" attr
*/
else if( e.value) {
var d = new Date( Date.parse( e.value))
e.value = d.toLocaleDateString();
}
}
Then we could flag pertinent elements with class 'date-time' for
instance and apply that function using whatever Calagator users to
apply JavaScript when the DOM changes.