You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(common): add injection token for default DatePipe configuration (#47157)
This commit introduces a new `DATE_PIPE_DEFAULT_OPTIONS` token, which
can be used to configure default DatePipe options, such as date
format and timezone.
DEPRECATED:
The `DATE_PIPE_DEFAULT_TIMEZONE` token is now deprecated in favor
of the `DATE_PIPE_DEFAULT_OPTIONS` token, which accepts an object
as a value and the timezone can be defined as a field (called `timezone`)
on that object.
PR Close#47157
For information about Angular CDK and Angular Material deprecations, see the [changelog](https://github.com/angular/components/blob/main/CHANGELOG.md).
93
94
@@ -110,6 +111,7 @@ In the [API reference section](api) of this site, deprecated APIs are indicated
110
111
|:--- |:--- |:--- |:--- |
111
112
|[`CurrencyPipe` - `DEFAULT_CURRENCY_CODE`](api/common/CurrencyPipe#currency-code-deprecation)|`{provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}`| v9 | From v11 the default code will be extracted from the locale data given by `LOCALE_ID`, rather than `USD`. |
112
113
|[`NgComponentOutlet.ngComponentOutletNgModuleFactory`](api/common/NgComponentOutlet)|`NgComponentOutlet.ngComponentOutletNgModule`| v14 | Use the `ngComponentOutletNgModule` input instead. This input doesn't require resolving NgModule factory. |
114
+
|[`DatePipe` - `DATE_PIPE_DEFAULT_TIMEZONE`](api/common/DATE_PIPE_DEFAULT_TIMEZONE)|`{ provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: { timezone: '-1200' }`| v15 | Use the `DATE_PIPE_DEFAULT_OPTIONS` injection token, which can configure multiple settings at once instead. |
0 commit comments