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 {
|
|
|
|
|
2021-04-03 13:38:25 +02:00
|
|
|
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());
|
2022-03-20 11:21:25 +01:00
|
|
|
try {
|
|
|
|
if (localStorage.getItem("bstly.darkTheme") == "true") {
|
|
|
|
window.document.body.classList.add("dark-theme");
|
|
|
|
}
|
|
|
|
} catch { }
|
2020-11-02 08:29:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|