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 { DossierAttributesService } from '@shared/services/controller-wrappers/dossier-attributes.service';
|
||||
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({
|
||||
selector: 'redaction-edit-dossier-attributes',
|
||||
templateUrl: './edit-dossier-attributes.component.html',
|
||||
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 {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
@ -53,7 +73,10 @@ export class EditDossierAttributesComponent implements EditDossierSectionInterfa
|
||||
}
|
||||
|
||||
get valid(): boolean {
|
||||
return this.form.valid;
|
||||
if (this.form) {
|
||||
return this.form.valid;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user