Zimlet JavaScript API Reference - AjxTimezone

Class AjxTimezone




Defined in: AjxTimezone.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
This class holds all of the known timezone rules.
Field Summary
Field Attributes Field Name and Description
<static>  
AjxTimezone.AUTO_DETECTED
Note: Do NOT change this value because it is used to reference messages.
<static>  
AjxTimezone.GMT
Client identifier for GMT.
<static>  
AjxTimezone.GMT_NO_DST
Client identifier for GMT with no daylight savings time.
<static>  
AjxTimezone.STANDARD_RULES
The data is specified using the server identifiers for historical reasons.
Class Detail
AjxTimezone()
This class holds all of the known timezone rules. Each timezone is represented by an object that has a unique identifier and the offset to UTC in standard time. If the timezone defines daylight savings time, then additional information is provided (e.g. when the DST takes effect and it's offset to UTC).

Both the standard and daylight information are specified as objects with the following properties:

offset
The offset to UTC (in minutes)
mon
The transition month of the year (January = 1, ...).
week
The transition week of the month (First = 1, ..., Fourth = 4, Last = -1).
wkday
The transition day of the week (Sunday = 1, ...).
mday
The transition day of the month (1, ... 31).
hour
The transition hour (midnight = 0, noon = 12, ...).
min
The transition minute.
sec
The transition second (which is usually 0).
Notes
  • Timezones with no DST only specify an id and a standard info object with a single "offset" property.
  • Timezones with a DST must provide standard and daylight info objects.
  • If timezone has DST, then the following properties of the standard and daylight info objects are required: offset, month, hour, min, sec.
  • Transition dates are specified in only one of the following ways:
    • by specifying a specific date of the year (e.g. March 10);
    • or by specifying the day of a specific week within some month (e.g. Second Wednesday, Last Saturday, etc).
  • If the transition date is specified as a specific date of the year, then the following field in the standard and/or daylight info objects are required: mday.
  • If the transition date is specified as the day of a specific week, then the following fields in the standard and/or daylight info objects are required: week, wkday.
Examples
Timezone with no DST
  var timezone = { clientId: "My Timezone", standard: { offset: -480 } };
  
America/Los_Angeles, 2007
  var standard = {
    offset: -480,
    mon: 11, week: 1, wkday: 1,
    hour: 2, min: 0, sec: 0    
  };
  var daylight = {
    offset: -420,
    mon: 3, week: 2, wkday: 1,
    hour: 2, min: 0, sec: 0
  };
  var timezone = { clientId: "My Timezone",
                   standard: standard, daylight: daylight };
  
Custom US/Pacific using 11 Mar 2007 and 2 Dec 2007
  var standard = {
    offset: -480,
    mon: 11, mday: 2,
    hour: 2, min: 0, sec: 0
  };
  var daylight = {
    offset: -420,
    mon: 3, mday: 11,
    hour: 2, min: 0, sec: 0
  };
  var timezone = { clientId: "My Timezone",
                   standard: standard, daylight: daylight };
  

Note: Specifying a transition date using a specific date of the year should be avoided.


This class stores mappings between client and server identifiers for timezones as well as attempting to guess the default timezone. The application can override this value, through a user preference perhaps, by setting the DEFAULT property's value. The default timezone is specified using the client identifier.

Field Detail
<static> AjxTimezone.AUTO_DETECTED
Note: Do NOT change this value because it is used to reference messages.

<static> AjxTimezone.GMT
Client identifier for GMT.

Note: UK observes daylight savings time so this constant should not be used as the reference point (i.e. UTC) -- use AjxTimezone.GMT_NO_DST instead. The name of this constant is historical.


<static> AjxTimezone.GMT_NO_DST
Client identifier for GMT with no daylight savings time.

<static> AjxTimezone.STANDARD_RULES
The data is specified using the server identifiers for historical reasons. Perhaps in the future we'll use the client (i.e. Java) identifiers on the server as well.

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:30 GMT-0400 (EDT)