changed input date format
This commit is contained in:
parent
b477905fa1
commit
aa795d1259
@ -7,11 +7,31 @@ import { FormBuilder, FormGroup } from '@angular/forms';
|
|||||||
import * as moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { DossierAttributesService } from '@shared/services/controller-wrappers/dossier-attributes.service';
|
import { DossierAttributesService } from '@shared/services/controller-wrappers/dossier-attributes.service';
|
||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
|
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
|
||||||
|
import { MomentDateAdapter } from '@angular/material-moment-adapter';
|
||||||
|
|
||||||
|
export const DATE_FORMATS = {
|
||||||
|
parse: {
|
||||||
|
dateInput: 'YYYY-MM-DD',
|
||||||
|
},
|
||||||
|
display: {
|
||||||
|
dateInput: 'YYYY-MM-DD',
|
||||||
|
monthYearLabel: 'YYYY',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'redaction-edit-dossier-attributes',
|
selector: 'redaction-edit-dossier-attributes',
|
||||||
templateUrl: './edit-dossier-attributes.component.html',
|
templateUrl: './edit-dossier-attributes.component.html',
|
||||||
styleUrls: ['./edit-dossier-attributes.component.scss'],
|
styleUrls: ['./edit-dossier-attributes.component.scss'],
|
||||||
|
providers: [
|
||||||
|
{
|
||||||
|
provide: DateAdapter,
|
||||||
|
useClass: MomentDateAdapter,
|
||||||
|
deps: [MAT_DATE_LOCALE],
|
||||||
|
},
|
||||||
|
{ provide: MAT_DATE_FORMATS, useValue: DATE_FORMATS },
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class EditDossierAttributesComponent implements EditDossierSectionInterface, OnInit {
|
export class EditDossierAttributesComponent implements EditDossierSectionInterface, OnInit {
|
||||||
readonly iconButtonTypes = IconButtonTypes;
|
readonly iconButtonTypes = IconButtonTypes;
|
||||||
@ -53,8 +73,11 @@ export class EditDossierAttributesComponent implements EditDossierSectionInterfa
|
|||||||
}
|
}
|
||||||
|
|
||||||
get valid(): boolean {
|
get valid(): boolean {
|
||||||
|
if (this.form) {
|
||||||
return this.form.valid;
|
return this.form.valid;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this._loadingService.start();
|
this._loadingService.start();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user