mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
73 lines
2.0 KiB
TypeScript
73 lines
2.0 KiB
TypeScript
import { Component } from '@angular/core';
|
|
|
|
import { Platform } from '@ionic/angular';
|
|
import { StatusBar } from '@ionic-native/status-bar/ngx';
|
|
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
|
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
|
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
|
import { InativityService } from "src/app/services/inativity.service";
|
|
import { ThemeService } from 'src/app/services/theme.service';
|
|
import { environment } from 'src/environments/environment';
|
|
import { Storage } from '@ionic/storage';
|
|
import { ChatController } from './controller/chat';
|
|
|
|
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
|
parse: {
|
|
dateInput: "YYYY-MMMM-DD HH:mm"
|
|
},
|
|
display: {
|
|
dateInput: "DD MMM YYYY H:mm",
|
|
monthYearLabel: "MMM YYYY",
|
|
dateA11yLabel: "LL",
|
|
monthYearA11yLabel: "MMMM YYYY"
|
|
}
|
|
}
|
|
|
|
|
|
@Component({
|
|
selector: 'app-root',
|
|
templateUrl: 'app.component.html',
|
|
styleUrls: ['app.component.scss'],
|
|
providers: [
|
|
{ provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATE_FORMATS },
|
|
]
|
|
})
|
|
export class AppComponent {
|
|
constructor(
|
|
private platform: Platform,
|
|
private statusBar: StatusBar,
|
|
public ThemeService: ThemeService,
|
|
private storage: Storage,
|
|
private ChatSystemService: ChatSystemService
|
|
) {
|
|
this.initializeApp();
|
|
this.storage.set('version', environment.version).then(() => {})
|
|
|
|
ChatController.ChatSystemService = this.ChatSystemService
|
|
}
|
|
|
|
initializeApp() {
|
|
this.platform.ready().then(() => {
|
|
this.statusBar.styleDefault();
|
|
/* this.splashScreen.hide(); */
|
|
|
|
if (this.platform.is("tablet")) {
|
|
window.screen.orientation.unlock();
|
|
} else if( this.platform.is("mobile")) {
|
|
window.screen.orientation.lock('portrait');
|
|
}
|
|
|
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
|
|
|
} else {
|
|
try {
|
|
// this.sqliteservice.databaseConn();
|
|
} catch (error) {
|
|
|
|
}
|
|
}
|
|
|
|
});
|
|
}
|
|
}
|