we_bstly-web/src/app/app.component.ts

26 lines
552 B
TypeScript
Raw Normal View History

2021-10-05 15:16:59 +02:00
import { Component } from '@angular/core';
2020-11-02 08:29:52 +01:00
2021-10-05 15:16:59 +02:00
import { I18nService } from './services/i18n.service';
import { DateAdapter } from '@angular/material/core';
2020-11-02 08:29:52 +01:00
@Component({
selector: 'app-root',
2021-10-05 15:16:59 +02:00
templateUrl: './app.component.html'
2020-11-02 08:29:52 +01:00
})
export class AppComponent {
constructor(
private i18n: I18nService,
private _adapter: DateAdapter<any>) {
2021-03-18 15:12:30 +01:00
}
ngOnInit() {
2021-10-05 15:16:59 +02:00
this._adapter.setLocale(this.i18n.getLocale());
if (localStorage.getItem("bstly.darkTheme") == "true") {
window.document.body.classList.add("dark-theme");
}
2020-11-02 08:29:52 +01:00
}
}