48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import { Component, OnInit, AfterContentInit } from '@angular/core';
|
|
import { MAT_DATE_LOCALE, MAT_DATE_FORMATS, provideNativeDateAdapter } from '@angular/material/core';
|
|
import { Title } from '@angular/platform-browser';
|
|
|
|
import { FullComponent } from '@components/shared/layout';
|
|
import { UserService } from "@services";
|
|
|
|
export const MY_FORMATS = {
|
|
parse: {
|
|
dateInput: 'DD/MM/YYYY',
|
|
},
|
|
display: {
|
|
dateInput: 'DD/MM/YYYY',
|
|
monthYearLabel: 'MMM YYYY',
|
|
dateA11yLabel: 'LL',
|
|
monthYearA11yLabel: 'MMMM-YYYY',
|
|
},
|
|
};
|
|
|
|
@Component({
|
|
selector: 'app-root',
|
|
standalone: true,
|
|
imports: [
|
|
FullComponent
|
|
],
|
|
providers: [
|
|
{ provide: MAT_DATE_LOCALE, useValue: 'fr-FR' },
|
|
{ provide: MAT_DATE_FORMATS, useValue: MY_FORMATS },
|
|
provideNativeDateAdapter(MY_FORMATS)
|
|
],
|
|
templateUrl: './app.component.html',
|
|
styleUrl: './app.component.scss'
|
|
})
|
|
export class AppComponent implements OnInit, AfterContentInit {
|
|
public title = 'Ad Astra';
|
|
public appClass = 'grayscale';
|
|
|
|
constructor(private userService: UserService, private titleService: Title) { }
|
|
|
|
ngOnInit() {
|
|
this.userService.populate();
|
|
this.titleService.setTitle(this.title);
|
|
}
|
|
|
|
ngAfterContentInit() {
|
|
this.appClass = 'colored';
|
|
}
|
|
} |