mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4684] Content Metadata Card dates should be localised (#4944)
* [ADF-4684] Content Metadata Card dates should be localised * Passed locale param in datePipe * Set default locale value in card-view-dateitem model * Updated property locale in card-view-dateitem component on change in language * * Added test case * * Added unit test case * * Removing locale arg from datepipe
This commit is contained in:
@@ -71,7 +71,10 @@ export class CardViewDateItemComponent implements OnInit, OnDestroy {
|
||||
this.userPreferencesService
|
||||
.select(UserPreferenceValues.Locale)
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe(locale => this.dateAdapter.setLocale(locale));
|
||||
.subscribe(locale => {
|
||||
this.dateAdapter.setLocale(locale);
|
||||
this.property.locale = locale;
|
||||
});
|
||||
|
||||
(<MomentDateAdapter> this.dateAdapter).overrideDisplayFormat = 'MMM DD';
|
||||
|
||||
|
@@ -36,7 +36,7 @@ export class CardViewDateItemModel extends CardViewBaseItemModel implements Card
|
||||
}
|
||||
|
||||
if (cardViewDateItemProperties.locale) {
|
||||
this.format = cardViewDateItemProperties.locale;
|
||||
this.locale = cardViewDateItemProperties.locale;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user