Branch: Tag:

2012-05-17

2012-05-17 12:21:56 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Calendar.Timezone: Attempt to support timezone abbreviations.

1356:   #endif    if (!zone_cache) parse_all_rules();    object ret = zone_cache[s]; -  if (ret) return ret; +  if (!zero_type(ret)) return ret || UNDEFINED;    Zone z; -  if (!(z = zones[s])) return UNDEFINED; +  if (!(z = zones[s])) { +  // Check if it's a known alias. +  // FIXME: Ought to select the most recent user of the abbreviation. +  array(string) a = .TZnames.abbr2zones[s]; +  if (a && sizeof(a)) +  return zone_cache[s] = find_zone(a[0]); +  return UNDEFINED; +  }    ret = z->compile();    foreach(z->aliases, string zone_alias) {    zone_cache[zone_alias] = ret;