mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-1694] Datepicker should be localizable (#2471)
* Add locate as user preference property * The datepicker should be localizable. Save the locale as user preference The app should get the default locale from the store or appcongif or Browser or en * Fix build error * Fix unit test date widget * Needs more investigation * Fix import UserPreference * Rollback date format change
This commit is contained in:
committed by
Eugenio Romano
parent
415d6c7a4a
commit
fa7f89c75f
@@ -18,8 +18,9 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';
|
||||
import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material';
|
||||
import * as moment from 'moment';
|
||||
import { Moment } from 'moment';
|
||||
import { LightUserRepresentation, LogService, MOMENT_DATE_FORMATS,
|
||||
MomentDateAdapter, PeopleProcessService } from 'ng2-alfresco-core';
|
||||
MomentDateAdapter, PeopleProcessService, UserPreferencesService } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { Form } from '../models/form.model';
|
||||
import { StartTaskModel } from '../models/start-task.model';
|
||||
@@ -71,12 +72,18 @@ export class StartTaskComponent implements OnInit {
|
||||
* @param translate
|
||||
* @param taskService
|
||||
*/
|
||||
constructor(private taskService: TaskListService,
|
||||
private peopleService: PeopleProcessService,
|
||||
private logService: LogService) {
|
||||
constructor(
|
||||
private taskService: TaskListService,
|
||||
private peopleService: PeopleProcessService,
|
||||
private dateAdapter: DateAdapter<Moment>,
|
||||
private preferences: UserPreferencesService,
|
||||
private logService: LogService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.preferences.locale$.subscribe( (locale) => {
|
||||
this.dateAdapter.setLocale(locale);
|
||||
});
|
||||
this.loadFormsTask();
|
||||
this.getUsers();
|
||||
}
|
||||
|
Reference in New Issue
Block a user