@@ -44,6 +44,8 @@ export class MyModule {
44
44
}
45
45
```
46
46
47
+ Also, every pipe accepts the ` locale ` option.
48
+
47
49
Now you can use the pipes, see below.
48
50
49
51
## Pipes
@@ -64,8 +66,11 @@ The input date can be one of the following:
64
66
* null
65
67
* undefined
66
68
67
- The options are a subset of the options for ` new Intl.DateTimeFormat() ` . For a list of the options, see
68
- their [ docs] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options ) .
69
+ The following options are supported:
70
+
71
+ * [ ` dateStyle ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#datestyle )
72
+ * [ ` timeStyle ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#timestyle )
73
+ * [ ` hour12 ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#hour12 )
69
74
70
75
With the ` INTL_DATE_PIPE_DEFAULT_OPTIONS ` injection token you can specify default options.
71
76
@@ -84,8 +89,15 @@ The input can be one of the following:
84
89
* null
85
90
* undefined
86
91
87
- The options are a subset of the options for ` new Intl.NumberFormat() ` . For a list of the options, see
88
- their [ docs] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options ) .
92
+ The following options are supported:
93
+
94
+ * [ ` notation ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#notation )
95
+ * [ ` signDisplay ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#signdisplay )
96
+ * [ ` minimumIntegerDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumintegerdigits )
97
+ * [ ` minimumFractionDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumfractiondigits )
98
+ * [ ` maximumFractionDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumfractiondigits )
99
+ * [ ` minimumSignificantDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumsignificantdigits )
100
+ * [ ` maximumSignificantDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumsignificantdigits )
89
101
90
102
With the ` INTL_DECIMAL_PIPE_DEFAULT_OPTIONS ` injection token you can specify default options.
91
103
@@ -104,8 +116,15 @@ The input can be one of the following:
104
116
* null
105
117
* undefined
106
118
107
- The options are a subset of the options for ` new Intl.NumberFormat() ` . For a list of the options, see
108
- their [ docs] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options ) .
119
+ The following options are supported:
120
+
121
+ * [ ` notation ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#notation )
122
+ * [ ` signDisplay ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#signdisplay )
123
+ * [ ` minimumIntegerDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumintegerdigits )
124
+ * [ ` minimumFractionDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumfractiondigits )
125
+ * [ ` maximumFractionDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumfractiondigits )
126
+ * [ ` minimumSignificantDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumsignificantdigits )
127
+ * [ ` maximumSignificantDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumsignificantdigits )
109
128
110
129
With the ` INTL_PERCENT_PIPE_DEFAULT_OPTIONS ` injection token you can specify default options.
111
130
@@ -127,8 +146,17 @@ The input can be one of the following:
127
146
The currency code parameter is required and must be a valid ISO 4217 currency code. If you want to transform a decimal
128
147
number instead, use the ` intlDecimal ` pipe.
129
148
130
- The options are a subset of the options for ` new Intl.NumberFormat() ` . For a list of the options, see
131
- their [ docs] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options ) .
149
+ The following additional options are supported:
150
+
151
+ * [ ` currencyDisplay ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencydisplay )
152
+ * [ ` currencySign ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencysign )
153
+ * [ ` notation ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#notation )
154
+ * [ ` signDisplay ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#signdisplay )
155
+ * [ ` minimumIntegerDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumintegerdigits )
156
+ * [ ` minimumFractionDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumfractiondigits )
157
+ * [ ` maximumFractionDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumfractiondigits )
158
+ * [ ` minimumSignificantDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumsignificantdigits )
159
+ * [ ` maximumSignificantDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumsignificantdigits )
132
160
133
161
With the ` INTL_CURRENCY_PIPE_DEFAULT_OPTIONS ` injection token you can specify default options.
134
162
@@ -146,8 +174,9 @@ The input can be one of the following:
146
174
* null
147
175
* undefined
148
176
149
- The options are a subset of the options for ` new Intl.DisplayNames() ` . For a list of the options, see
150
- their [ docs] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/DisplayNames#options ) .
177
+ The following option is supported:
178
+
179
+ * [ ` languageDisplay ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/DisplayNames#languagedisplay )
151
180
152
181
With the ` INTL_LANGUAGE_PIPE_DEFAULT_OPTIONS ` injection token you can specify default options.
153
182
@@ -165,11 +194,6 @@ The input can be one of the following:
165
194
* null
166
195
* undefined
167
196
168
- The options are a subset of the options for ` new Intl.DisplayNames() ` . For a list of the options, see
169
- their [ docs] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/DisplayNames#options ) .
170
-
171
- With the ` INTL_COUNTRY_PIPE_DEFAULT_OPTIONS ` injection token you can specify default options.
172
-
173
197
### Unit pipe
174
198
175
199
Use the unit pipe like the following:
@@ -189,8 +213,16 @@ The unit parameter is required, see
189
213
the [ specification] ( https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier )
190
214
for a full list of possible values. If you want to transform a decimal number instead, use the ` intlDecimal ` pipe.
191
215
192
- The options are a subset of the options for ` new Intl.NumberFormat() ` . For a list of the options, see
193
- their [ docs] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options ) .
216
+ The following additional options are supported:
217
+
218
+ * [ ` unitDisplay ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#unitdisplay )
219
+ * [ ` notation ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#notation )
220
+ * [ ` signDisplay ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#signdisplay )
221
+ * [ ` minimumIntegerDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumintegerdigits )
222
+ * [ ` minimumFractionDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumfractiondigits )
223
+ * [ ` maximumFractionDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumfractiondigits )
224
+ * [ ` minimumSignificantDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumsignificantdigits )
225
+ * [ ` maximumSignificantDigits ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumsignificantdigits )
194
226
195
227
With the ` INTL_UNIT_PIPE_DEFAULT_OPTIONS ` injection token you can specify default options.
196
228
@@ -208,13 +240,18 @@ The input can be one of the following:
208
240
* null
209
241
* undefined
210
242
211
- The options are a subset of the options for ` new Intl.ListFormat() ` . For a list of the options, see
212
- their [ docs] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#options ) .
243
+ The following options are supported:
244
+
245
+ * [ ` type ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#type )
246
+ * [ ` style ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#style )
213
247
214
248
With the ` INTL_LIST_PIPE_DEFAULT_OPTIONS ` injection token you can specify default options.
215
249
216
250
## Relative Time (timeago) pipe
217
251
252
+ The relative time format will format the input date compared to the current date in a "timeago" format. Every minute,
253
+ the value will be updated automatically.
254
+
218
255
Use the relative time pipe like the following:
219
256
220
257
```
@@ -229,8 +266,10 @@ The input date can be one of the following:
229
266
* null
230
267
* undefined
231
268
232
- The options are a subset of the options for ` new Intl.RelativeTimeFormat() ` . For a list of the options, see
233
- their [ docs] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#options ) .
269
+ The following options are supported:
270
+
271
+ * [ ` numeric ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#numeric )
272
+ * [ ` style ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#style )
234
273
235
274
With the ` INTL_RELATIVE_TIME_PIPE_DEFAULT_OPTIONS ` injection token you can specify default options.
236
275
0 commit comments