Skip to main content

HS.Timezone.Server.Schema

class HS.Timezone.Server.Schema extends %Library.RegisteredObject

Contains the json representation of all time zone and time zone rules. Generated from files produced by the tz database.

Property Inventory

Method Inventory

Properties

property Rules as %DynamicObject;
Rules will be of the following structure: { "US": [ //Name of a rule. Will have a list of configurations that are //active for different years. Each configuration also indicates //what month, day, and time it goes into effect, as well as how //much to offset the time zone by. { "FromYear": "1840", //Year that the rule was first in effect. "ToYear": "max", //Year that the rule went out of effect. "max" means it is currently //in effect and "only" means it was only in effect for one year (FromYear). "Month": "3", //Month the rule begins to take effect. 1=Jan, 2=Feb, ... "Day": "Sun>=8", //Day the rule takes effect. Can be DOW>=X, lastDOW, or X, where X is //a numbered day. "Time": "2:00", //Time the rule change takes effect. "Offset": "1:00", //How much time to save from the time zone's standard offset. So a rule //offset of 1:00 would turn -05:00 into -04:00. "AbbreviationLetter": "D" //Letter to insert into the time zone abbreviation. So E%sT would display //EDT when this rule configuration is active. }, { //Complementary rule configuration to the one above, when it goes from DST //back to standard time. "FromYear": "1840", "ToYear": "max", "Month": "11", "Day": "Sun>=1", "Time": "2:00", "Offset": "0", "AbbreviationLetter": "S" } ] }
Property methods: RulesGet(), RulesGetObject(), RulesGetObjectId(), RulesGetSwizzled(), RulesIsValid(), RulesNewObject(), RulesSet(), RulesSetObject(), RulesSetObjectId(), RulesUnSwizzle()
property Timezones as %DynamicObject;
Timezones will be of the following structure: { "America/New_York": [ //Name of the time zone. Region and location are separated by //a "/". Will have a list of configurations //that are active for different years, using different rules. { "StdOffset":"-05:00", //The offset from UTC during standard time. "Abbreviation": "E%sT", //Abbreviation for the time zone. Not a unique key. %s will be replaced //with a letter defined in the rule. Not all abbreviations have a %s. "Rule": "US", //Name of the rule definition for this configuration. References one //of the entries in the Rules object. If no rule is defined, the value //must be a "-", and the time zone is always in standard time "UntilDate":"" //Date this rule stops being effective. Blank means it is currently active. //Is usually just a year, but can also be of format 1883 Nov 18 12:00:04. } ] }
Property methods: TimezonesGet(), TimezonesGetObject(), TimezonesGetObjectId(), TimezonesGetSwizzled(), TimezonesIsValid(), TimezonesNewObject(), TimezonesSet(), TimezonesSetObject(), TimezonesSetObjectId(), TimezonesUnSwizzle()

Methods

method %OnNew() as %Status
Instantiates two objects on startup to be used by the timezone service. One containing all time zones and their configurations, another containing all time zone rules and their configurations.
classmethod ValidateRules(rules As %DynamicObject, filePath As %String) as %Boolean
Validates timezone rules object has correct structure and can be used by timezone service.
@Argument rules Object containing time zone rules and their configurations @Argument filePath Path to metadata file being validated
classmethod ValidateTimezones(timezones As %DynamicObject, filePath As %String) as %Boolean
Validates timezones object has correct structure and can be used by timezone service.
@Argument timezones Object containing time zones and their configurations @Argument filePath Path to metadata file being validated

Inherited Members

Inherited Methods

FeedbackOpens in a new tab