From 1d9bf75e59923e5e36deefc3c10419c02fd364b3 Mon Sep 17 00:00:00 2001 From: Hedi Date: Sat, 5 Mar 2022 10:45:23 +0100 Subject: [PATCH] fix formulaire --- .../page-ajout-evenements.component.html | 72 +++++++++++++------ .../page-ajout-evenements.component.ts | 16 +++-- 2 files changed, 61 insertions(+), 27 deletions(-) diff --git a/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.html b/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.html index a65589c..4c68aa6 100644 --- a/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.html +++ b/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.html @@ -6,26 +6,56 @@

Ajouter un évènement à l'agenda

-
-
+
+
-
- - +
+
+
+ + +
+
+
+
+ + +
+
-
- - +
+
+
+ + +
+
+
+
+ + +
+
- - + [disabled]="eventForm.invalid">Ajouter + Annuler
diff --git a/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.ts b/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.ts index 68d53a1..3d06070 100644 --- a/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.ts +++ b/src/app/pages/page-ajout-evenements/page-ajout-evenements.component.ts @@ -27,20 +27,24 @@ export class PageAjoutEvenementsComponent implements OnInit { this.teamId = this.tokenService.getCurrentTeamId(); this.eventForm = new FormGroup({ - startFc : new FormControl(''), - endFc : new FormControl(''), + startDateFc : new FormControl(''), + startHourFc : new FormControl(''), + endDateFc : new FormControl(''), + endHourFc : new FormControl(''), textFc : new FormControl('', [ Validators.required]) }) } public onSubmit(): void { - const startValue = this.eventForm.value['startFc']; - const endValue = this.eventForm.value['endFc']; + const startDateValue = this.eventForm.value['startDateFc']; + const startHourValue = this.eventForm.value['startHourFc']; + const endDateValue = this.eventForm.value['endDateFc']; + const endHourValue = this.eventForm.value['endHourFc']; const textValue = this.eventForm.value['textFc']; const event = { - start: startValue, - end: endValue, + start: startDateValue+'T'+startHourValue+':00', + end: endDateValue+'T'+endHourValue+':00', text: textValue, id:"", membre: {id:this.userId},