mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4680] Add documentation for dateValues in app.config.json (#4859)
* [ADF-4680] Add documentation for dateValues in app.config.json * Improve English * Create new localization file * Update localized-date.pipe.md * Update card-view-datetimeitem.model.ts * Update localized-date.pipe.md
This commit is contained in:
committed by
Eugenio Romano
parent
e64eee90af
commit
25446b5ba3
@@ -33,7 +33,7 @@ The pipe takes a date and formats it and localizes it so the date is displayed i
|
||||
|
||||
To localize the dates in your application, 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).
|
||||
|
||||
If you want add the japanese date localization in your ADF app you can add in your ```app.module.ts```:
|
||||
For example, if you want add the japanese date localization in your ADF app you can add in your ```app.module.ts```:
|
||||
|
||||
```typescript
|
||||
import { AppConfigService, TRANSLATION_PROVIDER, DebugAppConfigService, CoreModule, CoreAutomationService } from '@alfresco/adf-core';
|
||||
@@ -48,3 +48,23 @@ registerLocaleData(localeJa);
|
||||
|
||||
|
||||
```
|
||||
|
||||
### Default values
|
||||
|
||||
You can overwrite the default values of this pipe by adding these properties to your ```app.config.json```:
|
||||
|
||||
```json
|
||||
"dateValues": {
|
||||
"defaultDateFormat": "mediumDate",
|
||||
"defaultDateTimeFormat": "MMM d, y, H:mm",
|
||||
"defaultLocale": "en-US"
|
||||
}
|
||||
```
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| defaultDateFormat | string | The format to apply to date values |
|
||||
| defaultDateTimeFormat | string | The format to apply to date-time values |
|
||||
| defaultLocale | string | The locale id to apply |
|
||||
|
||||
This configuration overwrites the values in the localized date pipe as well as other components to have more consistency across your app. However, you can still overwrite these values any time by using the pipe in your code.
|
||||
|
Reference in New Issue
Block a user