mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
* [ADF-4342] Date Format defined in app config * [ADF-4342] Create localized pipe and centralize date format * Add unit test for new date pipe * Add info internationalization docs * Fix lining * Fix linting * Fix date pipe unit test * [ADF-4342] Add supported language files * Fix e2e tests
29 lines
1.1 KiB
Markdown
29 lines
1.1 KiB
Markdown
# [Localized Date pipe](../../../lib/core/pipes/localized-date.pipe.ts "Defined in localized-date.pipe.ts")
|
|
|
|
Converts a date to an given format and locale.
|
|
|
|
## Basic Usage
|
|
|
|
<!-- {% raw %} -->
|
|
|
|
```HTML
|
|
<div>
|
|
Created date: {{ date | adfLocalizedDate }}
|
|
</div>
|
|
```
|
|
|
|
<!-- {% endraw %} -->
|
|
|
|
### Properties
|
|
|
|
| Name | Type | Default value | Description |
|
|
| ---- | ---- | ------------- | ----------- |
|
|
| format | string | 'medium' | A format to apply to the date value. [Date Pipe Formats.](https://angular.io/api/common/DatePipe#custom-format-options) |
|
|
| locale | string | 'en-US' | A locale id for the locale format rules to use. |
|
|
|
|
## Details
|
|
|
|
The pipe takes a date and formats it and localizes it so the date is displayed in the proper format for the region. It uses the [Angular Date Pipe](https://angular.io/api/common/DatePipe#custom-format-options) so all the pre-defined and custom formats can be used.
|
|
|
|
When localizing a date, you will need to add the specific locale file for your region in order to use it. Read more about internationalization [here](https://angular.io/guide/i18n#i18n-pipes).
|