PDA

View Full Version : Anyone come up with a better UI for timezone selection?



simeon
19 Mar 2009, 12:57 PM
Hey,

I am currently stuck with this mammoth list of timezones that the server side java components spits out. It has numerous values for each time zone. It looks something like this:

(GMT-11:00) Pacific/Midway

Supposedly some of these options have specialized daylight savings time settings.

I am trying to get my head around the factors at play on this.

Has anyone come up with a better UI for timezone selection other than a select box with 100+ options in it?

Animal
19 Mar 2009, 1:01 PM
Yes, Java covers all possible bases doesn't it. We had that problem. I'll look at our code tomorrow to see how we cut down the liost to manageable proportions.

sartori
19 Mar 2009, 8:40 PM
This not ext.js but it is a pretty cool way of selecting timezones using google maps

http://www.gchart.com/

It's accurate enough to cover things like Florida having two time zones.

Would be cool to have this as an ext plugin.

Animal
20 Mar 2009, 12:44 AM
We drop a whole load of time zones when we iterate through to create the List for the combo:



java.util.TimeZone[] timeZones = DateUtils.getAllTimeZones(); // function to get them all
for (java.util.TimeZone t : timeZones) {
String id = t.getID();

// 3 Character time zone codes are deprecated in JRE 1.5 because there are ambiguities:
// "CST" could be U.S. "Central Standard Time" or "China Standard Time"
if ((id.length() > 3) && !id.startsWith("Etc")) {
String tzName = t.getDisplayName();

// Don't include zones with generic "GMT+n" descriptions.
if (!tzName.startsWith("GMT-") && !tzName.startsWith("GMT+")) {
// add to List

simeon
23 Mar 2009, 1:13 PM
thanks nige!