How exactly is the parameter TimeZone in the BandInfo used

251 views
Skip to first unread message

ora

unread,
Mar 17, 2009, 10:06:13 AM3/17/09
to SIMILE Widgets
Hi,

I am trying to figure out what exactly is the timeZone parameter
purpose is.

lets say I set it to +2, and load events that have a specific date, is
the time zone supposed to affect the event's time (it doesnt work from
what I see , at least not in version 2.3.1).

I also saw in this group someone talking about a problem with the
timeZone - does this problem still exists?

Thanks

Larry Kluger

unread,
Mar 17, 2009, 1:34:59 PM3/17/09
to simile-...@googlegroups.com

Hi Ora,

It would be a *giant* help if you could look into the issues that you raise, see below. Please let us know what you find out.

Thanks.

There are many different aspects to Timeline and Timezones (TZ):
a) If an event time is specified as a Gregorian date string, then it appears from my code reading that
1) The SimileAjax.DateTime.parseGregorianDateTime is used from ajax/api/scripts/date-time
2) The  timezone of the user's browser will be used.
 
b) ISO8601 strings can include an optional timezone. If the timezone is included, it is used. Else, the browser's timezone is used.
 See SimileAjax.DateTime.setIso8601 in ajax/api/scripts/date-time

c) If the dates are specified by using JS Date objects, then the TZ is set at that time.

d) If used, the timezone of the browser which may or may not be set correctly depending on the individual user and his or her computer or browser.

e) The timezone of the band (what you asked about) is used by the labeller to create the labels on the Timeline band.
I don't have the time right now to investigate this further, see the 
createLabeller(this._locale, this._timeZone)  and Timeline.GregorianDateLabeller functions.
It is also used for calculating the period of time that will be displayed on the ether. See ether-painters lines 60 and 195

f) The timezone is shown in
1) The labels on the bands. (See the labellers)
2) In the bubbles.

My suggestions:
1) I think the idea is that if the browser's TZ is used, then the band's specified TZ will be used to override/correct the browser's TZ. But this needs to be checked/verified by writing an example that uses Gregorian dates.
2) It would also be great to try out different combinations of specifying the TZ in ISO8601 dates and the band's TZ parameter
3) Also see what TZ is used in the pop-up bubbles. Is it the date's TZ, or the band's TZ?

4) You can also think in terms of what are called "local times" -- this is where you don't really know or care what the timezone is. In this situation, you want the Timeline to show "9 am" and not have a TZ in the bubble or elsewhere.

Recommendations:
1) Create some sample data in your preferred format and experiment with it and Timeline. If you paint your own bubble content then you have additional flexibility.
2) If you know the TZ of your data then you probably want the right TZ to show on your bubbles. If you don't know the TZ of your events then you shouldn't show the TZ since you don't know it. In this case, you'd want to override the bubble painter to enable you to not include the TZ.
3) Be aware of the TZ of your data in your database. Date objects always have some TZ, so if you don't specify it then you're leaving yourself open to problems later on. You should make an explicit decision about your data's timezone. Decide if you know it or not. If you don't, then be sure that the TZ of all your data will be set to either a specific TZ (often local) or UTC (aka GMT).

Hope this helped,

Larry



From: ora <oeg...@gmail.com>
To: SIMILE Widgets <simile-...@googlegroups.com>
Sent: Tuesday, March 17, 2009 10:06:13 AM
Subject: How exactly is the parameter TimeZone in the BandInfo used

David Huynh

unread,
Mar 18, 2009, 5:29:37 PM3/18/09
to simile-...@googlegroups.com
I've made a simple test for timezones:
http://simile-widgets.googlecode.com/svn/timeline/trunk/src/webapp/examples/test_timezones/test_timezones.html

Each band is set to a different time zone, and that affects where it
paints the time markers. For example, where the GMT band (band 4) paints
"0hr" (midnight), the -05:00 band (band 3) paints "19hr" (7pm of the
previous day) because it's running behind 5 hours.

Also note that the events end up getting parsed to different GMT times
depending on the time zones specified (or left unspecified) in their
"start" properties. When unspecified, as implemented, the event's time
is assumed to be in the browser's time zone.

There is one thing I'd consider wrong in the current implementation: I
think band 0 should be exactly like band 1. That is, when a *band* is
given no time zone, it should assume the browser's time zone (just as
times of *events* already do). I remember thinking about fixing this
problem, but not going through because of backward compatibility.

David
> ------------------------------------------------------------------------
> *From:* ora <oeg...@gmail.com>
> *To:* SIMILE Widgets <simile-...@googlegroups.com>
> *Sent:* Tuesday, March 17, 2009 10:06:13 AM
> *Subject:* How exactly is the parameter TimeZone in the BandInfo used

Larry Kluger

unread,
Mar 18, 2009, 6:12:59 PM3/18/09
to simile-...@googlegroups.com

Thanks David,

This is really helpful.

Larry


From: David Huynh <dfh...@alum.mit.edu>
To: simile-...@googlegroups.com
Sent: Wednesday, March 18, 2009 5:29:37 PM
Subject: Re: How exactly is the parameter TimeZone in the BandInfo used
Reply all
Reply to author
Forward
0 new messages