This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathindex.html
280 lines (195 loc) · 43.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
<!doctype html>
<head><meta charset="utf-8">
<meta charset="utf8">
<link href="ecmarkup.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<script src="ecmarkup.js"></script>
<title>Intl.RelativeTimeFormat Spec Proposal</title><script type="application/json" id="menu-search-biblio">[{"type":"op","aoid":"InitializeRelativeTimeFormat","refId":"sec-InitializeRelativeTimeFormat","location":"","referencingIds":[],"key":"InitializeRelativeTimeFormat"},{"type":"clause","id":"sec-InitializeRelativeTimeFormat","aoid":"InitializeRelativeTimeFormat","title":"InitializeRelativeTimeFormat (relativeTimeFormat, locales, options)","titleHTML":"InitializeRelativeTimeFormat (relativeTimeFormat, locales, options)","number":"1.1.1","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":["_ref_38"],"key":"InitializeRelativeTimeFormat (relativeTimeFormat, locales, options)"},{"type":"op","aoid":"PartitionRelativeTimePattern","refId":"sec-PartitionRelativeTimePattern","location":"","referencingIds":[],"key":"PartitionRelativeTimePattern"},{"type":"clause","id":"sec-PartitionRelativeTimePattern","aoid":"PartitionRelativeTimePattern","title":"PartitionRelativeTimePattern (relativeTimeFormat, value, unit)","titleHTML":"PartitionRelativeTimePattern (relativeTimeFormat, value, unit)","number":"1.1.2","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":["_ref_29","_ref_30"],"key":"PartitionRelativeTimePattern (relativeTimeFormat, value, unit)"},{"type":"op","aoid":"makepartslist","refId":"sec-makepartslist","location":"","referencingIds":[],"key":"makepartslist"},{"type":"clause","id":"sec-makepartslist","aoid":"makepartslist","title":"MakePartsList ( parts, unit, value )","titleHTML":"MakePartsList ( parts, unit, value )","number":"1.1.3","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":[],"key":"MakePartsList ( parts, unit, value )"},{"type":"op","aoid":"FormatRelativeTime","refId":"sec-FormatRelativeTime","location":"","referencingIds":[],"key":"FormatRelativeTime"},{"type":"clause","id":"sec-FormatRelativeTime","aoid":"FormatRelativeTime","title":"FormatRelativeTime (relativeTimeFormat, value, unit)","titleHTML":"FormatRelativeTime (relativeTimeFormat, value, unit)","number":"1.1.4","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":["_ref_15","_ref_43"],"key":"FormatRelativeTime (relativeTimeFormat, value, unit)"},{"type":"op","aoid":"FormatRelativeTimeToParts","refId":"sec-FormatRelativeTimeToParts","location":"","referencingIds":[],"key":"FormatRelativeTimeToParts"},{"type":"clause","id":"sec-FormatRelativeTimeToParts","aoid":"FormatRelativeTimeToParts","title":"FormatRelativeTimeToParts (relativeTimeFormat, value, unit)","titleHTML":"FormatRelativeTimeToParts (relativeTimeFormat, value, unit)","number":"1.1.5","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":["_ref_47"],"key":"FormatRelativeTimeToParts (relativeTimeFormat, value, unit)"},{"type":"clause","id":"sec-intl-relativetimeformat--abstracts","aoid":null,"title":"Abstract Operations for RelativeTimeFormat Objects","titleHTML":"Abstract Operations for RelativeTimeFormat Objects","number":"1.1","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":[],"key":"Abstract Operations for RelativeTimeFormat Objects"},{"type":"clause","id":"sec-Intl.RelativeTimeFormat","aoid":null,"title":"Intl.RelativeTimeFormat ([ locales [ , options ]])","titleHTML":"Intl.RelativeTimeFormat ([ locales [ , options ]])","number":"1.2.1","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":[],"key":"Intl.RelativeTimeFormat ([ locales [ , options ]])"},{"type":"clause","id":"sec-intl-relativetimeformat-constructor","aoid":null,"title":"The Intl.RelativeTimeFormat Constructor","titleHTML":"The Intl.RelativeTimeFormat Constructor","number":"1.2","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":[],"key":"The Intl.RelativeTimeFormat Constructor"},{"type":"clause","id":"sec-Intl.RelativeTimeFormat.prototype","aoid":null,"title":"Intl.RelativeTimeFormat.prototype","titleHTML":"Intl.RelativeTimeFormat.prototype","number":"1.3.1","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":[],"key":"Intl.RelativeTimeFormat.prototype"},{"type":"clause","id":"sec-Intl.RelativeTimeFormat.supportedLocalesOf","aoid":null,"title":"Intl.RelativeTimeFormat.supportedLocalesOf (locales [, options ])","titleHTML":"Intl.RelativeTimeFormat.supportedLocalesOf (locales [, options ])","number":"1.3.2","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":[],"key":"Intl.RelativeTimeFormat.supportedLocalesOf (locales [, options ])"},{"type":"clause","id":"sec-Intl.RelativeTimeFormat-internal-slots","aoid":null,"title":"Internal slots","titleHTML":"Internal slots","number":"1.3.3","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":["_ref_0"],"key":"Internal slots"},{"type":"clause","id":"sec-properties-of-intl-relativetimeformat-constructor","aoid":null,"title":"Properties of the Intl.RelativeTimeFormat Constructor","titleHTML":"Properties of the Intl.RelativeTimeFormat Constructor","number":"1.3","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":[],"key":"Properties of the Intl.RelativeTimeFormat Constructor"},{"type":"clause","id":"sec-Intl.RelativeTimeFormat.prototype.constructor","aoid":null,"title":"Intl.RelativeTimeFormat.prototype.constructor","titleHTML":"Intl.RelativeTimeFormat.prototype.constructor","number":"1.4.1","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":[],"key":"Intl.RelativeTimeFormat.prototype.constructor"},{"type":"clause","id":"sec-Intl.RelativeTimeFormat.prototype-toStringTag","aoid":null,"title":"Intl.RelativeTimeFormat.prototype[ @@toStringTag ]","titleHTML":"Intl.RelativeTimeFormat.prototype[ @@toStringTag ]","number":"1.4.2","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":[],"key":"Intl.RelativeTimeFormat.prototype[ @@toStringTag ]"},{"type":"clause","id":"sec-Intl.RelativeTimeFormat.prototype.format","aoid":null,"title":"Intl.RelativeTimeFormat.prototype.format( value, unit )","titleHTML":"Intl.RelativeTimeFormat.prototype.format( value, unit )","number":"1.4.3","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":[],"key":"Intl.RelativeTimeFormat.prototype.format( value, unit )"},{"type":"clause","id":"sec-Intl.RelativeTimeFormat.prototype.formatToParts","aoid":null,"title":"Intl.RelativeTimeFormat.prototype.formatToParts( value, unit )","titleHTML":"Intl.RelativeTimeFormat.prototype.formatToParts( value, unit )","number":"1.4.4","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":[],"key":"Intl.RelativeTimeFormat.prototype.formatToParts( value, unit )"},{"type":"clause","id":"sec-Intl.RelativeTimeFormat.prototype.resolvedOptions","aoid":null,"title":"Intl.RelativeTimeFormat.prototype.resolvedOptions ()","titleHTML":"Intl.RelativeTimeFormat.prototype.resolvedOptions ()","number":"1.4.5","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":[],"key":"Intl.RelativeTimeFormat.prototype.resolvedOptions ()"},{"type":"clause","id":"sec-properties-of-intl-relativetimeformat-prototype-object","aoid":null,"title":"Properties of the Intl.RelativeTimeFormat Prototype Object","titleHTML":"Properties of the Intl.RelativeTimeFormat Prototype Object","number":"1.4","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":[],"key":"Properties of the Intl.RelativeTimeFormat Prototype Object"},{"type":"clause","id":"sec-properties-of-intl-relativetimeformat-instances","aoid":null,"title":"Properties of Intl.RelativeTimeFormat Instances","titleHTML":"Properties of Intl.RelativeTimeFormat Instances","number":"1.5","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":["_ref_1"],"key":"Properties of Intl.RelativeTimeFormat Instances"},{"type":"clause","id":"relativetimeformat-objects","aoid":null,"title":"RelativeTimeFormat Objects","titleHTML":"RelativeTimeFormat Objects","number":"1","namespace":"https://rawgit.com/tc39/proposal-intl-relative-time/master/index.html","location":"","referencingIds":[],"key":"RelativeTimeFormat Objects"}]</script></head><body><div id="menu-toggle">☰</div><div id="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins</div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle">◢</span><a href="#relativetimeformat-objects" title="RelativeTimeFormat Objects"><span class="secnum">1</span> RelativeTimeFormat Objects</a><ol class="toc"><li><span class="item-toggle">◢</span><a href="#sec-intl-relativetimeformat--abstracts" title="Abstract Operations for RelativeTimeFormat Objects"><span class="secnum">1.1</span> Abstract Operations for RelativeTimeFormat Objects</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-InitializeRelativeTimeFormat" title="InitializeRelativeTimeFormat (relativeTimeFormat, locales, options)"><span class="secnum">1.1.1</span> InitializeRelativeTimeFormat (relativeTimeFormat, locales, options)</a></li><li><span class="item-toggle-none"></span><a href="#sec-PartitionRelativeTimePattern" title="PartitionRelativeTimePattern (relativeTimeFormat, value, unit)"><span class="secnum">1.1.2</span> PartitionRelativeTimePattern (relativeTimeFormat, value, unit)</a></li><li><span class="item-toggle-none"></span><a href="#sec-makepartslist" title="MakePartsList ( parts, unit, value )"><span class="secnum">1.1.3</span> MakePartsList ( parts, unit, value )</a></li><li><span class="item-toggle-none"></span><a href="#sec-FormatRelativeTime" title="FormatRelativeTime (relativeTimeFormat, value, unit)"><span class="secnum">1.1.4</span> FormatRelativeTime (relativeTimeFormat, value, unit)</a></li><li><span class="item-toggle-none"></span><a href="#sec-FormatRelativeTimeToParts" title="FormatRelativeTimeToParts (relativeTimeFormat, value, unit)"><span class="secnum">1.1.5</span> FormatRelativeTimeToParts (relativeTimeFormat, value, unit)</a></li></ol></li><li><span class="item-toggle">◢</span><a href="#sec-intl-relativetimeformat-constructor" title="The Intl.RelativeTimeFormat Constructor"><span class="secnum">1.2</span> The Intl.RelativeTimeFormat Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-Intl.RelativeTimeFormat" title="Intl.RelativeTimeFormat ([ locales [ , options ]])"><span class="secnum">1.2.1</span> Intl.RelativeTimeFormat ([ locales [ , options ]])</a></li></ol></li><li><span class="item-toggle">◢</span><a href="#sec-properties-of-intl-relativetimeformat-constructor" title="Properties of the Intl.RelativeTimeFormat Constructor"><span class="secnum">1.3</span> Properties of the Intl.RelativeTimeFormat Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-Intl.RelativeTimeFormat.prototype" title="Intl.RelativeTimeFormat.prototype"><span class="secnum">1.3.1</span> Intl.RelativeTimeFormat.prototype</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.RelativeTimeFormat.supportedLocalesOf" title="Intl.RelativeTimeFormat.supportedLocalesOf (locales [, options ])"><span class="secnum">1.3.2</span> Intl.RelativeTimeFormat.supportedLocalesOf (locales [, options ])</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.RelativeTimeFormat-internal-slots" title="Internal slots"><span class="secnum">1.3.3</span> Internal slots</a></li></ol></li><li><span class="item-toggle">◢</span><a href="#sec-properties-of-intl-relativetimeformat-prototype-object" title="Properties of the Intl.RelativeTimeFormat Prototype Object"><span class="secnum">1.4</span> Properties of the Intl.RelativeTimeFormat Prototype Object</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-Intl.RelativeTimeFormat.prototype.constructor" title="Intl.RelativeTimeFormat.prototype.constructor"><span class="secnum">1.4.1</span> Intl.RelativeTimeFormat.prototype.constructor</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.RelativeTimeFormat.prototype-toStringTag" title="Intl.RelativeTimeFormat.prototype[ @@toStringTag ]"><span class="secnum">1.4.2</span> Intl.RelativeTimeFormat.prototype[ @@toStringTag ]</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.RelativeTimeFormat.prototype.format" title="Intl.RelativeTimeFormat.prototype.format( value, unit )"><span class="secnum">1.4.3</span> Intl.RelativeTimeFormat.prototype.format( value, unit )</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.RelativeTimeFormat.prototype.formatToParts" title="Intl.RelativeTimeFormat.prototype.formatToParts( value, unit )"><span class="secnum">1.4.4</span> Intl.RelativeTimeFormat.prototype.formatToParts( value, unit )</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.RelativeTimeFormat.prototype.resolvedOptions" title="Intl.RelativeTimeFormat.prototype.resolvedOptions ()"><span class="secnum">1.4.5</span> Intl.RelativeTimeFormat.prototype.resolvedOptions ()</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-properties-of-intl-relativetimeformat-instances" title="Properties of Intl.RelativeTimeFormat Instances"><span class="secnum">1.5</span> Properties of Intl.RelativeTimeFormat Instances</a></li></ol></li></ol></div></div><div id="spec-container"><h1 class="version first">July 14, 2017</h1><h1 class="title">Intl.RelativeTimeFormat Spec Proposal</h1>
<emu-import href="./relativetimeformat.html"><emu-clause id="relativetimeformat-objects">
<h1><span class="secnum">1</span>RelativeTimeFormat Objects</h1>
<emu-clause id="sec-intl-relativetimeformat--abstracts">
<h1><span class="secnum">1.1</span>Abstract Operations for RelativeTimeFormat Objects</h1>
<emu-clause id="sec-InitializeRelativeTimeFormat" aoid="InitializeRelativeTimeFormat">
<h1><span class="secnum">1.1.1</span>InitializeRelativeTimeFormat (relativeTimeFormat, locales, options)</h1>
<p>
The abstract operation InitializeRelativeTimeFormat accepts the arguments <var>relativeTimeFormat</var> (which must be an object), <var>locales</var>, and <var>options</var>. It initializes <var>relativeTimeFormat</var> as a RelativeTimeFormat object. It performas the following steps:
</p>
<emu-alg><ol><li>If <var>relativeTimeFormat</var> has an [[InitializedIntlObject]] internal slot with value <emu-val>true</emu-val>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Set <var>relativeTimeFormat</var>.[[InitializedIntlObject]] to <emu-val>true</emu-val>.</li><li>Let <var>requestedLocales</var> be ? CanonicalizeLocaleList(<var>locales</var>).</li><li>If <var>options</var> is <emu-val>undefined</emu-val>, then<ol><li>Let <var>options</var> be <emu-xref aoid="ObjectCreate" id="_ref_2"><a href="https://tc39.github.io/ecma262/#sec-objectcreate">ObjectCreate</a></emu-xref>(<emu-val>%ObjectPrototype%</emu-val>).</li></ol></li><li>Else<ol><li>Let <var>options</var> be ? <emu-xref aoid="ToObject" id="_ref_3"><a href="https://tc39.github.io/ecma262/#sec-toobject">ToObject</a></emu-xref>(<var>options</var>).</li></ol></li><li>Let <var>opt</var> be a new <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.github.io/ecma262/#sec-list-and-record-specification-type">Record</a></emu-xref>.</li><li>Let <var>matcher</var> be ? GetOption(<var>options</var>, <code>"localeMatcher"</code>, <code>"string"</code>, «<code>"lookup"</code>, <code>"best fit"</code>», <code>"best fit"</code>).</li><li>Set <var>opt</var>.[[LocaleMatcher]] to <var>matcher</var>.</li><li>Let <var>localeData</var> be <emu-val>%RelativeTimeFormat%</emu-val>.[[LocaleData]].</li><li>Let <var>r</var> be ResolveLocale(<emu-val>%RelativeTimeFormat%</emu-val>.[[AvailableLocales]], <var>requestedLocales</var>, <var>opt</var>, <emu-val>%RelativeTimeFormat%</emu-val>.[[RelevantExtensionKeys]], <var>localeData</var>).</li><li>Set <var>relativeTimeFormat</var>.[[Locale]] to the value of <var>r</var>.[[Locale]].</li><li>Let <var>dataLocale</var> be <var>r</var>.[[DataLocale]].</li><li>Let <var>s</var> be ? GetOption(<var>options</var>, <code>"style"</code>, <code>"string"</code>, «<code>"long"</code>, <code>"short"</code>, <code>"narrow"</code>», <code>"long"</code>).</li><li>Set <var>relativeTimeFormat</var>.[[Style]] to <var>s</var>.</li><li>Let <var>dataLocaleData</var> be <emu-xref aoid="Get" id="_ref_4"><a href="https://tc39.github.io/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>localeData</var>, <var>dataLocale</var>).</li><li>Let <var>fields</var> be <emu-xref aoid="Get" id="_ref_5"><a href="https://tc39.github.io/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>dataLocaleData</var>, <emu-val>"fields"</emu-val>).</li><li>Assert: <var>fields</var> is an object (see <emu-xref href="#sec-Intl.RelativeTimeFormat-internal-slots" id="_ref_0"><a href="#sec-Intl.RelativeTimeFormat-internal-slots">1.3.3</a></emu-xref>).</li><li>Set <var>relativeTimeFormat</var>.[[Fields]] to <var>fields</var>.</li><li>Let <var>nfLocale</var> be <emu-xref aoid="CreateArrayFromList" id="_ref_6"><a href="https://tc39.github.io/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(« <var>locale</var> »).</li><li>Let <var>nfOptions</var> be <emu-xref aoid="ObjectCreate" id="_ref_7"><a href="https://tc39.github.io/ecma262/#sec-objectcreate">ObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-object-prototype-object"><a href="https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object">%ObjectPrototype%</a></emu-xref>).</li><li>Perform ! <emu-xref aoid="CreateDataPropertyOrThrow" id="_ref_8"><a href="https://tc39.github.io/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>nfOptions</var>, <code>"useGrouping"</code>, <emu-val>false</emu-val>).</li><li>Perform ! <emu-xref aoid="CreateDataPropertyOrThrow" id="_ref_9"><a href="https://tc39.github.io/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>nfOptions</var>, <code>"minimumIntegerDigits"</code>, <emu-val>2</emu-val>).</li><li>Let <var>relativeTimeFormat</var>.[[NumberFormat]] be ? <emu-xref aoid="Construct" id="_ref_10"><a href="https://tc39.github.io/ecma262/#sec-construct">Construct</a></emu-xref>(%NumberFormat%, « <var>nfLocale</var>, <var>nfOptions</var> »).</li><li>Let <var>prLocale</var> be <emu-xref aoid="CreateArrayFromList" id="_ref_11"><a href="https://tc39.github.io/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(« <var>locale</var> »).</li><li>Let <var>prOptions</var> be <emu-xref aoid="ObjectCreate" id="_ref_12"><a href="https://tc39.github.io/ecma262/#sec-objectcreate">ObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-object-prototype-object"><a href="https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object">%ObjectPrototype%</a></emu-xref>).</li><li>Perform ! <emu-xref aoid="CreateDataPropertyOrThrow" id="_ref_13"><a href="https://tc39.github.io/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>prOptions</var>, <code>"style"</code>, <code>"cardinal"</code>).</li><li>Let <var>relativeTimeFormat</var>.[[PluralRules]] be ? <emu-xref aoid="Construct" id="_ref_14"><a href="https://tc39.github.io/ecma262/#sec-construct">Construct</a></emu-xref>(%PluralRules%, « <var>prLocale</var>, <var>prOptions</var> »).</li><li>Set <var>relativeTimeFormat</var>.[[InitializedRelativeTimeFormat]] to <emu-val>true</emu-val>.</li><li>Return <var>relativeTimeFormat</var>.
</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-PartitionRelativeTimePattern" aoid="PartitionRelativeTimePattern">
<h1><span class="secnum">1.1.2</span>PartitionRelativeTimePattern (relativeTimeFormat, value, unit)</h1>
<p>
When the <emu-xref aoid="FormatRelativeTime" id="_ref_15"><a href="#sec-FormatRelativeTime">FormatRelativeTime</a></emu-xref> abstract operation is called with arguments <var>relativeTimeFormat</var>, <var>value</var>, and <var>unit</var> it returns a String value representing <var>value</var> (interpreted as a <emu-xref href="#sec-time-values-and-time-range"><a href="https://tc39.github.io/ecma262/#sec-time-values-and-time-range">time value</a></emu-xref> as specified in ES2016, 20.3.1.1) according to the effective locale and the formatting options of <var>relativeTimeFormat</var>.
</p>
<emu-alg><ol><li>Assert: <var>relativeTimeFormat</var>.[[InitializedRelativeTimeFormat]] is <emu-val>true</emu-val>.</li><li>Assert: <emu-xref aoid="Type" id="_ref_16"><a href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>value</var>) is a Number.</li><li>Assert: <emu-xref aoid="Type" id="_ref_17"><a href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>unit</var>) is a String.</li><li>If isFinite(<var>value</var>) is <emu-val>false</emu-val>, then throw a <emu-val>RangeError</emu-val> exception.</li><li>If <var>unit</var> is not one of <code>"second"</code>, <code>"minute"</code>, <code>"hour"</code>, <code>"day"</code>, <code>"week"</code>, <code>"month"</code>, <code>"quarter"</code>, <code>"year"</code>, throw a RangeError exception.</li><li>Let <var>fields</var> be <var>relativeTimeFormat</var>.[[Fields]].</li><li>Let <var>style</var> be <var>relativeTimeFormat</var>.[[Style]].</li><li>If <var>style</var> is equal to "short", then<ol><li>Let <var>entry</var> be <var>unit</var> + "-short".</li></ol></li><li>Else if <var>style</var> is equal to "narrow", then<ol><li>Let <var>entry</var> be <var>unit</var> + "-narrow".</li></ol></li><li>Else<ol><li>Let <var>entry</var> be <var>unit</var>.</li></ol></li><li>Let <var>exists</var> be ? <emu-xref aoid="HasProperty" id="_ref_18"><a href="https://tc39.github.io/ecma262/#sec-hasproperty">HasProperty</a></emu-xref>(<var>fields</var>, <var>entry</var>).</li><li>If <var>exists</var> is <emu-val>false</emu-val>, then<ol><li>Let <var>entry</var> be <var>unit</var>.</li></ol></li><li>Let <var>patterns</var> be ? <emu-xref aoid="Get" id="_ref_19"><a href="https://tc39.github.io/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>fields</var>, <var>entry</var>).</li><li>Let <var>exists</var> be ? <emu-xref aoid="HasProperty" id="_ref_20"><a href="https://tc39.github.io/ecma262/#sec-hasproperty">HasProperty</a></emu-xref>(<var>patterns</var>, <emu-xref aoid="ToString" id="_ref_21"><a href="https://tc39.github.io/ecma262/#sec-tostring">ToString</a></emu-xref>(<var>value</var>)).</li><li>If <var>exists</var> is <emu-val>true</emu-val>, then<ol><li>Let <var>result</var> be <emu-xref aoid="Get" id="_ref_22"><a href="https://tc39.github.io/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>patterns</var>, <emu-xref aoid="ToString" id="_ref_23"><a href="https://tc39.github.io/ecma262/#sec-tostring">ToString</a></emu-xref>(<var>value</var>)).</li><li>Return a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.github.io/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> containing the <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.github.io/ecma262/#sec-list-and-record-specification-type">Record</a></emu-xref> { [[Type]]: <code>"literal"</code>, [[Value]]: <var>result</var> }.</li></ol></li><li>If <var>value</var> is less than 0, then<ol><li>Let <var>tl</var> be <code>"past"</code>.</li></ol></li><li>Else<ol><li>Let <var>tl</var> be <code>"future"</code>.</li></ol></li><li>Let <var>po</var> be ? <emu-xref aoid="Get" id="_ref_24"><a href="https://tc39.github.io/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>patterns</var>, <var>tl</var>).</li><li>Let <var>fv</var> be ! FormatNumber(<var>relativeTimeFormat</var>.[[NumberFormat]], <var>value</var>).</li><li>Let <var>pr</var> be ! ResolvePlural(<var>relativeTimeFormat</var>.[[PluralRules]], <var>value</var>).</li><li>Let <var>pattern</var> be ? <emu-xref aoid="Get" id="_ref_25"><a href="https://tc39.github.io/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>po</var>, <var>pr</var>).</li><li>Return ? MakePartsList(<var>pattern</var>, <var>unit</var>, <var>fv</var>).
</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-makepartslist" aoid="makepartslist">
<h1><span class="secnum">1.1.3</span>MakePartsList ( parts, unit, value )</h1>
<p>
The MakePartsList abstract operation is called with arguments <var>parts</var>, a pattern String, <var>unit</var>, a String, and <var>value</var> a String.
<emu-note><span class="note">Note</span><div class="note-contents">
Example:
</div></emu-note></p><pre> MakePartsList("AA{0}BB", "hour", "15") --<
Output (List of Records):
[
{type: 'literal', value: 'AA'},
{type: 'hour', value: '15'},
{type: 'literal', value: 'BB'},
]
</pre>
<p></p>
<emu-alg><ol><li>Let <var>result</var> be a new empty <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.github.io/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>Let <var>beginIndex</var> be <emu-xref aoid="Call" id="_ref_26"><a href="https://tc39.github.io/ecma262/#sec-call">Call</a></emu-xref>(%StringProto_indexOf%, <var>pattern</var>, "{", <emu-val>0</emu-val>).</li><li>Let <var>length</var> be ! <emu-xref aoid="Get" id="_ref_27"><a href="https://tc39.github.io/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>parts</var>, <code>"length"</code>).</li><li>Assert: <var>length</var> is a non-negative integer.</li><li>Repeat while <var>beginIndex</var> is an integer index into <var>pattern</var>:<ol><li>Set <var>endIndex</var> to <emu-xref aoid="Call" id="_ref_28"><a href="https://tc39.github.io/ecma262/#sec-call">Call</a></emu-xref>(%StringProto_indexOf%, <var>pattern</var>, "}", <var>beginIndex</var>)</li><li>Assert: <var>endIndex</var> is not -1, otherwise the pattern would be malformed.</li><li>If <var>beginIndex</var> is greater than <var>nextIndex</var>, then:<ol><li>Let <var>literal</var> be a substring of <var>pattern</var> from position <var>nextIndex</var>, inclusive, to position <var>beginIndex</var>, exclusive.</li><li>Add new part record { [[Type]]: <code>"literal"</code>, [[Value]]: <var>literal</var> } as a new element of the list <var>result</var>.</li></ol></li><li>Let <var>p</var> be the substring of <var>pattern</var> from position <var>beginIndex</var>, exclusive, to position <var>endIndex</var>, exclusive.</li><li>Assert: <var>p</var> is <code>"0"</code>.</li><li>Add new part <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.github.io/ecma262/#sec-list-and-record-specification-type">Record</a></emu-xref> { [[Type]]: <var>unit</var>, [[Value]]: <var>value</var> } as a new element on the <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.github.io/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> <var>result</var>.</li></ol></li><li>If <var>nextIndex</var> is less than <var>length</var>, then:<ol><li>Let <var>literal</var> be the substring of <var>pattern</var> from position <var>nextIndex</var>, exclusive, to position <var>length</var>, exclusive.</li><li>Add new part record { [[Type]]: <code>"literal"</code>, [[Value]]: <var>literal</var> } as a new element of the list <var>result</var>.</li></ol></li><li>Return <var>result</var>.
</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-FormatRelativeTime" aoid="FormatRelativeTime">
<h1><span class="secnum">1.1.4</span>FormatRelativeTime (relativeTimeFormat, value, unit)</h1>
<p>
The FormatRelativeTime abstract operation is called with arguments <var>relativeTimeFormat</var> (which must be an object initialized as a RelativeTimeFormat), <var>value</var> (which must be a Number value), and <var>unit</var> (which must be a String denoting the value unit) and performs the following steps:
</p>
<emu-alg><ol><li>Let <var>parts</var> be ? <emu-xref aoid="PartitionRelativeTimePattern" id="_ref_29"><a href="#sec-PartitionRelativeTimePattern">PartitionRelativeTimePattern</a></emu-xref>(<var>relativeTimeFormat</var>, <var>value</var>, <var>unit</var>).</li><li>Let <var>result</var> be an empty String.</li><li>For each <var>part</var> in <var>parts</var>, do:<ol><li>Set <var>result</var> to a String value produced by concatenating <var>result</var> and <var>part</var>.[[Value]].</li></ol></li><li>Return <var>result</var>.
</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-FormatRelativeTimeToParts" aoid="FormatRelativeTimeToParts">
<h1><span class="secnum">1.1.5</span>FormatRelativeTimeToParts (relativeTimeFormat, value, unit)</h1>
The FormatRelativeTimeToParts abstract operation is called with arguments <var>relativeTimeFormat</var> (which must be an object initialized as a RelativeTimeFormat), <var>value</var> (which must be a Number value), and <var>unit</var> (which must be a String denoting the value unit) and performs the following steps:
<p>
</p>
<emu-alg><ol><li>Let <var>parts</var> be ? <emu-xref aoid="PartitionRelativeTimePattern" id="_ref_30"><a href="#sec-PartitionRelativeTimePattern">PartitionRelativeTimePattern</a></emu-xref>(<var>relativeTimeFormat</var>, <var>value</var>, <var>unit</var>).</li><li>Let <var>result</var> be <emu-xref aoid="ArrayCreate" id="_ref_31"><a href="https://tc39.github.io/ecma262/#sec-arraycreate">ArrayCreate</a></emu-xref>(0).</li><li>Let <var>n</var> be 0.</li><li>For each <var>part</var> in <var>parts</var>, do:<ol><li>Let <var>O</var> be <emu-xref aoid="ObjectCreate" id="_ref_32"><a href="https://tc39.github.io/ecma262/#sec-objectcreate">ObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-object-prototype-object"><a href="https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object">%ObjectPrototype%</a></emu-xref>).</li><li>Perform ! <emu-xref aoid="CreateDataPropertyOrThrow" id="_ref_33"><a href="https://tc39.github.io/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>O</var>, "type", <var>part</var>.[[Type]]).</li><li>Perform ! <emu-xref aoid="CreateDataPropertyOrThrow" id="_ref_34"><a href="https://tc39.github.io/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>O</var>, "value", <var>part</var>.[[Value]]).</li><li>Perform ! <emu-xref aoid="CreateDataPropertyOrThrow" id="_ref_35"><a href="https://tc39.github.io/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>result</var>, ! <emu-xref aoid="ToString" id="_ref_36"><a href="https://tc39.github.io/ecma262/#sec-tostring">ToString</a></emu-xref>(<var>n</var>), <var>O</var>).</li><li>Increment <var>n</var> by 1.</li></ol></li><li>Return <var>result</var>.
</li></ol></emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-intl-relativetimeformat-constructor">
<h1><span class="secnum">1.2</span>The Intl.RelativeTimeFormat Constructor</h1>
<p>
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 <emu-xref href="#sec-internal-slots"></emu-xref>.
</p>
<emu-clause id="sec-Intl.RelativeTimeFormat">
<h1><span class="secnum">1.2.1</span>Intl.RelativeTimeFormat ([ locales [ , options ]])</h1>
<p>
When the <emu-val>Intl.RelativeTimeFormat</emu-val> function is called with optional arguments the following steps are taken:
</p>
<emu-alg><ol><li>If NewTarget is <emu-val>undefined</emu-val>, let <var>newTarget</var> be the <emu-xref href="#active-function-object"><a href="https://tc39.github.io/ecma262/#active-function-object">active function object</a></emu-xref>, else let <var>newTarget</var> be NewTarget.</li><li>Let <var>relativeTimeFormat</var> be ! <emu-xref aoid="OrdinaryCreateFromConstructor" id="_ref_37"><a href="https://tc39.github.io/ecma262/#sec-ordinarycreatefromconstructor">OrdinaryCreateFromConstructor</a></emu-xref>(<var>newTarget</var>, <emu-val>%RelativeTimeFormatPrototype%</emu-val>).</li><li>Return ? <emu-xref aoid="InitializeRelativeTimeFormat" id="_ref_38"><a href="#sec-InitializeRelativeTimeFormat">InitializeRelativeTimeFormat</a></emu-xref>(<var>relativeTimeFormat</var>, <var>locales</var>, <var>options</var>).
</li></ol></emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-properties-of-intl-relativetimeformat-constructor">
<h1><span class="secnum">1.3</span>Properties of the Intl.RelativeTimeFormat Constructor</h1>
<p>
The Intl.RelativeTimeFormat constructor has the following properties:
</p>
<emu-clause id="sec-Intl.RelativeTimeFormat.prototype">
<h1><span class="secnum">1.3.1</span>Intl.RelativeTimeFormat.prototype</h1>
<p>
The value of <emu-val>Intl.RelativeTimeFormat.prototype</emu-val> is <emu-val>%RelativeTimeFormatPrototype%</emu-val>.
</p>
<p>
This property has the attributes { [[Writable]]: <emu-val>false</emu-val>, [[Enumerable]]: <emu-val>false</emu-val>, [[Configurable]]: <emu-val>false</emu-val> }.
</p>
</emu-clause>
<emu-clause id="sec-Intl.RelativeTimeFormat.supportedLocalesOf">
<h1><span class="secnum">1.3.2</span>Intl.RelativeTimeFormat.supportedLocalesOf (locales [, options ])</h1>
<p>
When the <emu-val>supportedLocalesOf</emu-val> method of <emu-val>%RelativeTimeFormat%</emu-val> is called, the following steps are taken:
</p>
<emu-alg><ol><li>Let <var>availableLocales</var> be <emu-val>%RelativeTimeFormat%</emu-val>.[[AvailableLocales]].</li><li>Let <var>requestedLocales</var> be CanonicalizeLocaleList(<var>locales</var>).</li><li>Return SupportedLocales(<var>availableLocales</var>, <var>requestedLocales</var>, <var>options</var>).
</li></ol></emu-alg>
<p>
The value of the <emu-val>length</emu-val> property of the <emu-val>supportedLocalesOf</emu-val> method is 1.
</p>
</emu-clause>
<emu-clause id="sec-Intl.RelativeTimeFormat-internal-slots">
<h1><span class="secnum">1.3.3</span>Internal slots</h1>
<p>
The value of the [[AvailableLocales]] internal slot is implementation defined within the constraints described in <emu-xref href="#sec-internal-slots"></emu-xref>.
</p>
<p>
The value of the [[RelevantExtensionKeys]] internal slot is [].
</p>
<emu-note><span class="note">Note 1</span><div class="note-contents">
Unicode Technical Standard 35 describes no locale extension keys that are relevant to relative time formatting.
</div></emu-note>
<p>
The value of the [[LocaleData]] internal slot is implementation defined within the constraints described in <emu-xref href="#sec-internal-slots"></emu-xref> and the following additional constraints:
</p>
<ul>
<li>[[LocaleData]][Locale] has ordinary data properties <code>"second"</code>, <code>"minute"</code>, <code>"hour"</code>, <code>"day"</code>, <code>"week"</code>, <code>"month"</code>, <code>"quarter"</code> and <code>"year"</code>. Additional property keys may exist with the previous names concatenated with the strings <code>"-narrow"</code> or <code>"-short"</code>. The values corresponding to these property keys are objects which contain these two categories of properties:</li>
<li><ul>
<li><code>"future"</code> and <code>"past"</code> properties, which are objects with a property for each of the [[PluralCategories]] in the Locale. The value corresponding to those properties is a pattern which may contain <code>"{0}"</code> to be replaced by a formatted number.</li>
<li>Optionally, additional properties whose key is the result of <emu-xref aoid="ToString" id="_ref_39"><a href="https://tc39.github.io/ecma262/#sec-tostring">ToString</a></emu-xref> of a Number, and whose values are literal Strings which are not treated as templates.</li>
</ul>
</li></ul>
<emu-note><span class="note">Note 2</span><div class="note-contents">
It is recommended that implementations use the locale data provided by the Common Locale Data Repository (available at <a href="http://cldr.unicode.org/">http://cldr.unicode.org/</a>).
</div></emu-note>
</emu-clause>
</emu-clause>
<emu-clause id="sec-properties-of-intl-relativetimeformat-prototype-object">
<h1><span class="secnum">1.4</span>Properties of the Intl.RelativeTimeFormat Prototype Object</h1>
<p>
The Intl.RelativeTimeFormat prototype object is itself an ordinary object. %RelativeTimeFormatPrototype% is not an Intl.RelativeTimeFormat instance and does not have an [[InitializedRelatimveTimeFormat]] internal slot or any of the other internal slots of Intl.RelativeTimeFormat instance objects.
</p>
<p>
In the following descriptions of functions that are properties or [[Get]] attributes of properties of <emu-val>%RelativeTimeFormatPrototype%</emu-val>, the phrase "this RelativeTimeFormat object" refers to the object that is the this value for the invocation of the function; a <emu-val>TypeError</emu-val> exception is thrown if the this value is not an object or an object that does not have an [[InitializedRelativeTimeFormat]] internal slot with value <emu-val>true</emu-val>.
</p>
<emu-clause id="sec-Intl.RelativeTimeFormat.prototype.constructor">
<h1><span class="secnum">1.4.1</span>Intl.RelativeTimeFormat.prototype.constructor</h1>
<p>
The initial value of <emu-val>Intl.RelativeTimeFormat.prototype.constructor</emu-val> is <emu-val>%RelativeTimeFormat%</emu-val>.
</p>
</emu-clause>
<emu-clause id="sec-Intl.RelativeTimeFormat.prototype-toStringTag">
<h1><span class="secnum">1.4.2</span>Intl.RelativeTimeFormat.prototype[ @@toStringTag ]</h1>
<p>
The initial value of the @@toStringTag property is the string value <code>"Object"</code>.
</p>
<p>
This property has the attributes { [[Writable]]: <emu-val>false</emu-val>, [[Enumerable]]: <emu-val>false</emu-val>, [[Configurable]]: <emu-val>true</emu-val> }.
</p>
</emu-clause>
<emu-clause id="sec-Intl.RelativeTimeFormat.prototype.format">
<h1><span class="secnum">1.4.3</span>Intl.RelativeTimeFormat.prototype.format( value, unit )</h1>
<p>
When the <emu-val>Intl.RelativeTimeFormat.prototype.format</emu-val> is called with an optional argument <var>value</var>, the following steps are taken:
</p>
<emu-alg><ol><li>Let <var>relativeTimeFormat</var> be <emu-val>this</emu-val> value.</li><li>If <emu-xref aoid="Type" id="_ref_40"><a href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>relativeTimeFormat</var>) is not Object or <var>relativeTimeFormat</var> does not have an [[InitializedRelativeTimeFormat]] internal slot whose value is <emu-val>true</emu-val>, throw a TypeError exception.</li><li>Let <var>value</var> be ? <emu-xref aoid="ToNumber" id="_ref_41"><a href="https://tc39.github.io/ecma262/#sec-tonumber">ToNumber</a></emu-xref>(<var>value</var>).</li><li>Let <var>unit</var> be ? <emu-xref aoid="ToString" id="_ref_42"><a href="https://tc39.github.io/ecma262/#sec-tostring">ToString</a></emu-xref>(<var>unit</var>).</li><li>Return ? <emu-xref aoid="FormatRelativeTime" id="_ref_43"><a href="#sec-FormatRelativeTime">FormatRelativeTime</a></emu-xref>(<var>relativeTimeFormat</var>, <var>value</var>, <var>unit</var>).
</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-Intl.RelativeTimeFormat.prototype.formatToParts">
<h1><span class="secnum">1.4.4</span>Intl.RelativeTimeFormat.prototype.formatToParts( value, unit )</h1>
<p>
When the <emu-val>Intl.RelativeTimeFormat.prototype.formatToParts</emu-val> is called with an optional argument <var>value</var>, the following steps are taken:
</p>
<emu-alg><ol><li>Let <var>relativeTimeFormat</var> be <emu-val>this</emu-val> value.</li><li>If <emu-xref aoid="Type" id="_ref_44"><a href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>relativeTimeFormat</var>) is not Object or <var>relativeTimeFormat</var> does not have an [[InitializedRelativeTimeFormat]] internal slot whose value is <emu-val>true</emu-val>, throw a TypeError exception.</li><li>Let <var>value</var> be ? <emu-xref aoid="ToNumber" id="_ref_45"><a href="https://tc39.github.io/ecma262/#sec-tonumber">ToNumber</a></emu-xref>(<var>value</var>).</li><li>Let <var>unit</var> be ? <emu-xref aoid="ToString" id="_ref_46"><a href="https://tc39.github.io/ecma262/#sec-tostring">ToString</a></emu-xref>(<var>unit</var>).</li><li>Return ? <emu-xref aoid="FormatRelativeTimeToParts" id="_ref_47"><a href="#sec-FormatRelativeTimeToParts">FormatRelativeTimeToParts</a></emu-xref>(<var>relativeTimeFormat</var>, <var>value</var>, <var>unit</var>).
</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-Intl.RelativeTimeFormat.prototype.resolvedOptions">
<h1><span class="secnum">1.4.5</span>Intl.RelativeTimeFormat.prototype.resolvedOptions ()</h1>
<p>
This function provides access to the locale and formatting options computed during initialization of the object.
</p>
<p>
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 <emu-xref href="#sec-properties-of-intl-relativetimeformat-instances" id="_ref_1"><a href="#sec-properties-of-intl-relativetimeformat-instances">1.5</a></emu-xref>): locale and style.
</p>
</emu-clause>
</emu-clause>
<emu-clause id="sec-properties-of-intl-relativetimeformat-instances">
<h1><span class="secnum">1.5</span>Properties of Intl.RelativeTimeFormat Instances</h1>
<p>
Intl.RelativeTimeFormat instances inherit properties from <emu-val>%RelativeTimeFormatPrototype%</emu-val>.
</p>
<p>
Intl.RelativeTimeFormat instances and other objects that have been successfully initialized as a RelativeTimeFormat have [[InitializedIntlObject]] and [[InitializedRelativeTimeFormat]] internal slots whose values are <emu-val>true</emu-val>.
</p>
<p>
Objects that have been successfully initialized as a RelativeTimeFormat object also have several internal slots that are computed by the constructor:
</p>
<ul>
<li>[[Locale]] is a String value with the language tag of the locale whose localization is used for formatting.</li>
<li>[[Style]] is one of the String values <code>"long"</code>, <code>"short"</code>, or <code>"narrow"</code>, identifying the relative time format style used.</li>
</ul>
</emu-clause>
</emu-clause>
</emu-import>
</div></body>