[OGo-XML-RPC] zOGI and timeZone
Adam Tauno Williams
xmlrpc@opengroupware.org
Fri, 25 Apr 2008 11:29:37 -0400
> Sorry, but I have one point, that I forgot (I wrote the last mail in a
> little bit of a hurry):
> In zOGIAction.m (trunk in svn rev. 968) line 458, there is the timeZone
> set by:
> [dateValue setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"GMT"]];
> So this should be the place where the timeZone is set.
> I recognized just this morning, that I commented this line out for
> debugging. Once again sorry.
Okay. :)
The whole -
dateValue = [dateValue dateByAddingYears:0
months:0
days:0
hours:0
minutes:0
seconds:(zoneDiff * -1)];
- should only kick in if the user sent the appointment with a
"timeZone" key, otherwise the value is assumed to be GMT. This is only
to allow the user to send something like -
app['start'] = '2007-02-18 13:00'
app['end'] = '2007-02-18 15:00'
app['timeZone'] = 'EST'
- and let the server do the conversion to GMT. Handy since having to
deal with timezones makes scripts, etc... and order of magnitude more
complicated. The values stored and those returned to the application
should *always* be GMT. If you don't send a "timeZone" key no
adjustment is made and it should be stored as-is as GMT.
If that isn't happening please let me know.
The other cheat supported for timezones is that the server will return
the timezone the user has defined as their default as well as what it
thinks the offset is from GMT for the start and end time. This way
making little widgets or web parts that can display calendar data in the
user's timezone is trivial. These are returned in the appointment like
-
'end': <DateTime '20070218T20:00:00' at 811df2c>,
'endOffset': -18000,
'offsetTimeZone': 'EDT',
'start': <DateTime '20070218T18:00:00' at 812546c>,
'startOffset': -18000,
- so all the data to display the event correctly is included in the
response. It should work even if the start and end spans a daylight
savings transition. Just add the provided offset to the appropriate
time value and you should achieve the value for the offsetTimeZone.
Timezones, and their abbreviations, can be retrieved form the server as
described at <http://code.google.com/p/zogi/wiki/timeZone>
Retrieving and setting a user's defaults, which contains the time zone,
is described at <http://code.google.com/p/zogi/wiki/defaults>. These
should be the same defaults as used by the WebUI.
--
Consonance: an Open Source .NET OpenGroupware client.
Contact:awilliam@whitemiceconsulting.com http://freshmeat.net/projects/consonance/