[ADF-4342] Create localized pipe and centralize date format (#4813)

* [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
This commit is contained in:
davidcanonieto
2019-06-11 09:35:35 +01:00
committed by Denys Vuika
parent 990fa4625b
commit 7497822a46
38 changed files with 473 additions and 67 deletions

View File

@@ -16,14 +16,26 @@
*/
import { TimeAgoPipe } from './time-ago.pipe';
import { async } from '@angular/core/testing';
import { async, TestBed } from '@angular/core/testing';
import { AppConfigService } from '../app-config/app-config.service';
import { UserPreferencesService } from '../services/user-preferences.service';
import { setupTestBed } from '../testing/setupTestBed';
import { CoreTestingModule } from '../testing/core.testing.module';
import { of } from 'rxjs';
describe('TimeAgoPipe', () => {
let pipe: TimeAgoPipe;
let userPreferences: UserPreferencesService;
setupTestBed({
imports: [CoreTestingModule]
});
beforeEach(async(() => {
pipe = new TimeAgoPipe();
userPreferences = TestBed.get(UserPreferencesService);
spyOn(userPreferences, 'select').and.returnValue(of(''));
pipe = new TimeAgoPipe(userPreferences, new AppConfigService(null));
}));
it('should return time difference for a given date', () => {