message: fix(pulse-plugin): fixed chart.js moment locale and date formats
diff: @@ -2,6 +2,9 @@ import { Component, OnInit } from '@angular/core';
  import { TranslateService } from '@ngx-translate/core';
  import { select, Store } from '@ngrx/store';
  import { first, switchMap } from 'rxjs/operators';
  +import { combineLatest } from 'rxjs';
  +import * as chart_moment from 'chart.js/node_modules/moment';
  +import 'moment/locale/ru';
  import { AsyncJobService } from './shared/services/async-job.service';
  import { AuthService } from './shared/services/auth.service';
  @@ -11,10 +14,6 @@ import { SessionStorageService } from './shared/services/session-storage.service
  import { StyleService } from './shared/services/style.service';
  import { DateTimeFormatterService } from './shared/services/date-time-formatter.service';
  import { State, UserTagsSelectors } from './root-store';
  -
  -import * as chart_moment from 'chart.js/node_modules/moment';
  -import 'moment/locale/ru';
  -import { Language } from './shared/types';
  import { Utils } from './shared/services/utils/utils.service';
  @Component({
  @@ -47,20 +46,23 @@ export class AppComponent implements OnInit {
  private configureInterface() {
  this.store.pipe(select(UserTagsSelectors.getInterfaceLanguage)).subscribe(language => {
  this.translateService.use(language);
  - // set locale for moment in the chart.js
  - chart_moment.locale(language);
  });
  this.store.pipe(select(UserTagsSelectors.getTimeFormat)).subscribe(timeFormat => {
  this.dateTimeFormatterService.updateFormatters(timeFormat);
  - // set time formats for locale of moment in the chart.js
  - chart_moment.updateLocale('en', {
  - longDateFormat: Utils.getMomentLongDateFormat(Language.en, timeFormat),
  });
  - chart_moment.updateLocale('ru', {
  - longDateFormat: Utils.getMomentLongDateFormat(Language.ru, timeFormat),
  +
  + // set locale and time formats for moment in the chart.js
  + combineLatest(
  + this.store.pipe(select(UserTagsSelectors.getInterfaceLanguage)),
  + this.store.pipe(select(UserTagsSelectors.getTimeFormat)),
  + ).subscribe(([language, timeFormat]) => {
  + chart_moment.locale(language);
  + chart_moment.updateLocale(language, {
  + longDateFormat: Utils.getMomentLongDateFormat(language, timeFormat),
  });
  });
  +
  this.store
  .pipe(select(UserTagsSelectors.getTheme))
  .subscribe(themeName => this.styleService.useTheme(themeName));
  