Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 1.27 KB

Timezone-Api.md

File metadata and controls

41 lines (26 loc) · 1.27 KB

Timezone API

availableTimezones()

Returns an array of supported TimezoneInfo.

getTimezone()

Returns the current TimezoneInfo.

setTimezone(timezoneId, options)

  1. timezoneId - string, timezone identificator.
  2. options is an optional object with one field:
    • disableUndo - boolean, flag that shows the undo action availability.

Sets the current timezone.

onTimezoneChanged

You can subscribe using the Subscription object returned by this function to be notified when the timezone is changed. You can also use the same object to unsubscribe from the event.

Example:

timezoneApi.onTimezoneChanged().subscribe(
    null,
    timezone => console.log(`New timezone: ${timezone}`),
    true
);

TimezoneInfo

TimezoneInfo is an object with the following fields:

  • id - string, timezone identificator.
  • title - string, timezone title.
  • offset - number, optional field that contains information about timezone offset.

Supported timezone identificators are timezones and exchange. exchange is a special "timezone" that means the timezone of a currently active symbol. Thus the actual timezone will be calculated every time a symbol changes.