Namespace: TimeZoneWidget

STX. TimeZoneWidget

This namespace is maintained for legacy implementations only (not using web components). New implementations should use functionality included in the web components (stxUI.js)
Lets users pick a local timezone for display on the xaxis of charts. Creates a menu structure which can be used to provide a user with timezone selection First level tier is the region. Each region has an array of cities. If the array is empty then no cities are available for that region. The timezone should be reconstructed as region/city. For instance, "America/New_York". Or for regions without cities simply "Iran". The reconstructed value can then be passed into stxx.setTimeZone();

Members


<static> timeZoneMap :Object

The comprehensive list of timezones can be overwhelming. This is a reduced list that provides just a single entry for each valid timezone. Each entry maps back to a valid stxTimeZoneData.js entry.

Type:
  • Object

Methods


<static> initialize( [initialTimeZone] [, cb])

Initialize the time zone manager with a prior saved timezone (initialTimeZone) and a callback mechanism for saving the timezone. Call this function when you initialize your UI.

Parameters:
Name Type Argument Description
initialTimeZone string <optional>

Default timezone to use

cb function <optional>

Callback function to store a different timezone that the user might pick through the menu fc(string)


<static> populateDialog()

Populates the timezone dialog. This generates a list from STX.TimeZoneWidget.timeZoneMap. Generally this method is called when the menu is enabled.


<static> removeTimeZone()

Removes the time zone from registered charts, and also from the attached storage mechanism.


<static> setTimeZone(zone)

Selects a time zone and enables it in all registered charts.

Parameters:
Name Type Description
zone string

A valid time zone