@@ -17,28 +17,37 @@ import {Component, ElementRef, OnInit} from '@angular/core';
17
17
18
18
import { LocalSettingsService } from '@common/services/global/localsettings' ;
19
19
import { ThemeService } from '@common/services/global/theme' ;
20
+ import { TimezoneService } from '@common/services/global/timezone' ;
20
21
import { TitleService } from '@common/services/global/title' ;
21
22
22
23
@Component ( { selector : 'kd-root' , template : '<router-outlet></router-outlet>' } )
23
24
export class RootComponent implements OnInit {
24
25
private _theme = this . _themeService . theme ;
26
+ private _timezone = this . _timezoneService . timezone ;
25
27
26
28
constructor (
27
29
private readonly _themeService : ThemeService ,
28
30
private readonly _localSettingService : LocalSettingsService ,
29
31
private readonly _overlayContainer : OverlayContainer ,
30
32
private readonly _kdRootRef : ElementRef ,
31
- private readonly _titleService : TitleService
33
+ private readonly _titleService : TitleService ,
34
+ private readonly _timezoneService : TimezoneService
32
35
) { }
33
36
34
37
ngOnInit ( ) : void {
35
38
this . _titleService . update ( ) ;
36
39
this . _themeService . subscribe ( this . onThemeChange_ . bind ( this ) ) ;
37
40
38
41
const localSettings = this . _localSettingService . get ( ) ;
39
- if ( localSettings && localSettings . theme ) {
40
- this . _theme = localSettings . theme ;
41
- this . _themeService . theme = localSettings . theme ;
42
+ if ( localSettings ) {
43
+ if ( localSettings . theme ) {
44
+ this . _theme = localSettings . theme ;
45
+ this . _themeService . theme = localSettings . theme ;
46
+ }
47
+ if ( localSettings . timezone ) {
48
+ this . _timezone = localSettings . timezone ;
49
+ this . _timezoneService . timezone = localSettings . timezone ;
50
+ }
42
51
}
43
52
44
53
this . applyOverlayContainerTheme_ ( '' , this . _theme ) ;
0 commit comments