fix formulaire
This commit is contained in:
parent
48dedea665
commit
1d9bf75e59
@ -6,26 +6,56 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 offset-md-4 text-center">
|
<div class="col-md-4 offset-md-4 text-center">
|
||||||
<h2>Ajouter un évènement à l'agenda</h2>
|
<h2>Ajouter un évènement à l'agenda</h2>
|
||||||
<div class="text-center col-md-6 offset-md-3">
|
<div class="text-center col-md-7 offset-md-3">
|
||||||
<main class="form-signup">
|
<main class="form-ajout-evenement">
|
||||||
<form (ngSubmit)="onSubmit()" [formGroup]="eventForm">
|
<form (ngSubmit)="onSubmit()" [formGroup]="eventForm">
|
||||||
<div class="form-floating">
|
<div class="row g-2">
|
||||||
<input type="datetime-local"
|
<div class="col-md">
|
||||||
class="form-control"
|
<div class="form-floating">
|
||||||
id="floatingInputDebut"
|
<input type="date"
|
||||||
placeholder=""
|
class="form-control"
|
||||||
name="start"
|
id="floatingInputDebut"
|
||||||
formControlName="startFc">
|
placeholder=""
|
||||||
<label for="floatingInputfirstName">Début</label>
|
name="startDate"
|
||||||
|
formControlName="startDateFc">
|
||||||
|
<label for="floatingInputfirstName">Date de début</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md">
|
||||||
|
<div class="form-floating">
|
||||||
|
<input type="time"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingInputDebut"
|
||||||
|
placeholder=""
|
||||||
|
name="startHour"
|
||||||
|
formControlName="startHourFc">
|
||||||
|
<label for="floatingInputfirstName">Heure de début</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating">
|
<div class="row g-2">
|
||||||
<input type="datetime-local"
|
<div class="col-md">
|
||||||
class="form-control"
|
<div class="form-floating">
|
||||||
id="floatingInputFin"
|
<input type="date"
|
||||||
placeholder=""
|
class="form-control"
|
||||||
name="end"
|
id="floatingInputFin"
|
||||||
formControlName="endFc">
|
placeholder=""
|
||||||
<label for="floatingInputlastName">Fin</label>
|
name="endDate"
|
||||||
|
formControlName="endDateFc">
|
||||||
|
<label for="floatingInputlastName">Date de fin</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md">
|
||||||
|
<div class="form-floating">
|
||||||
|
<input type="time"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingInputFin"
|
||||||
|
placeholder=""
|
||||||
|
name="endHour"
|
||||||
|
formControlName="endHourFc">
|
||||||
|
<label for="floatingInputlastName">Heure de fin</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="text"
|
<input type="text"
|
||||||
@ -36,10 +66,10 @@
|
|||||||
formControlName="textFc">
|
formControlName="textFc">
|
||||||
<label for="floatingInputlastName">Libelle</label>
|
<label for="floatingInputlastName">Libelle</label>
|
||||||
</div>
|
</div>
|
||||||
<button class="w-100 btn btn-lg btn-primary"
|
<button class="btn btn-lg btn-primary"
|
||||||
type="submit"
|
type="submit"
|
||||||
[disabled]="eventForm.invalid">Validation</button>
|
[disabled]="eventForm.invalid">Ajouter</button>
|
||||||
|
<a routerLink="../agenda" class="btn btn-lg btn-primary">Annuler</a>
|
||||||
</form>
|
</form>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
@ -27,20 +27,24 @@ export class PageAjoutEvenementsComponent implements OnInit {
|
|||||||
this.teamId = this.tokenService.getCurrentTeamId();
|
this.teamId = this.tokenService.getCurrentTeamId();
|
||||||
|
|
||||||
this.eventForm = new FormGroup({
|
this.eventForm = new FormGroup({
|
||||||
startFc : new FormControl(''),
|
startDateFc : new FormControl(''),
|
||||||
endFc : new FormControl(''),
|
startHourFc : new FormControl(''),
|
||||||
|
endDateFc : new FormControl(''),
|
||||||
|
endHourFc : new FormControl(''),
|
||||||
textFc : new FormControl('', [ Validators.required])
|
textFc : new FormControl('', [ Validators.required])
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public onSubmit(): void {
|
public onSubmit(): void {
|
||||||
const startValue = this.eventForm.value['startFc'];
|
const startDateValue = this.eventForm.value['startDateFc'];
|
||||||
const endValue = this.eventForm.value['endFc'];
|
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 textValue = this.eventForm.value['textFc'];
|
||||||
|
|
||||||
const event = {
|
const event = {
|
||||||
start: startValue,
|
start: startDateValue+'T'+startHourValue+':00',
|
||||||
end: endValue,
|
end: endDateValue+'T'+endHourValue+':00',
|
||||||
text: textValue,
|
text: textValue,
|
||||||
id:"",
|
id:"",
|
||||||
membre: {id:this.userId},
|
membre: {id:this.userId},
|
||||||
|
Loading…
Reference in New Issue
Block a user