The abstract operation InitializeRelativeTimeFormat accepts the arguments relativeTimeFormat (which must be an object), locales, and options. It initializes relativeTimeFormat as a RelativeTimeFormat object. It performas the following steps:
"useGrouping"
, "minimumIntegerDigits"
,
When the
The
Input: DeconstructPattern("AA{xx}BB{yy}CC", { xx: {type: 'hour', value: '15'}, yy: {type: 'minute', value: '06'} }); Output (List of Records): [ {type: 'literal', value: 'AA'}, {type: 'hour', value: '15'}, {type: 'literal', value: 'BB'}, {type: 'minute', value: '06'}, {type: 'literal', value: 'CC'} ]
The FormatRelativeTime abstract operation is called with arguments relativeTimeFormat (which must be an object initialized as a RelativeTimeFormat) and x (which must be a Number value), and performs the following steps:
When the GetBestMatchUnit abstract operation is called with argument units, the following steps are taken:
When the ComputeTimeUnits abstract operation is called with argument v, the following steps are taken:
where
The RelativeTimeFormat constructor is a standard built-in property of the Intl object. Behaviour common to all service constructor properties of the Intl object is specified in
When the
The Intl.RelativeTimeFormat constructor has the following properties:
The value of
This property has the attributes { [[Writable]]:
When the
The value of the
The value of the [[AvailableLocales]] internal slot is implementation defined within the constraints described in
The value of the [[RelevantExtensionKeys]] internal slot is [
The value of the [[LocaleData]] internal slot is implementation defined within the constraints described in
The Intl.RelativeTimeFormat prototype object is itself an Intl.RelativeTimeFormat instance as specified in
In the following descriptions of functions that are properties or [[Get]] attributes of properties of
The initial value of
The initial value of the @@toStringTag property is the string value
This property has the attributes { [[Writable]]:
When the
When the
This function provides access to the locale and formatting options computed during initialization of the object.
The function returns a new object whose properties and attributes are set as if constructed by an object literal assigning to each of the following properties the value of the corresponding internal slot of this RelativeTimeFormat object (see
Intl.RelativeTimeFormat instances inherit properties from
Intl.RelativeTimeFormat instances and other objects that have been successfully initialized as a RelativeTimeFormat have [[InitializedIntlObject]] and [[InitializedRelativeTimeFormat]] internal slots whose values are
Objects that have been successfully initialized as a RelativeTimeFormat object also have several internal slots that are computed by the constructor: