Fix duplicated inputs

This commit is contained in:
Peter Maquiran
2021-09-02 16:41:43 +01:00
parent 5de16776a2
commit f246db0054
3 changed files with 7 additions and 44 deletions
@@ -89,9 +89,6 @@ export class EditEventPage implements OnInit {
{ value: false, label: 'False' }
];
get dateOccurrence () {
return this.dateControlOccurrence.value
}
public listColors = ['primary', 'accent', 'warn'];
public stepHours = [1, 2, 3, 4, 5];
public stepMinutes = [1, 5, 10, 15, 20, 25];
@@ -109,6 +106,7 @@ export class EditEventPage implements OnInit {
ngOnInit() {
this.dateControlOccurrence = new FormControl(moment(this.postEvent.EventRecurrence.LastOccurrence));
this.postEvent.EventRecurrence.Type = '-1'
if(!this.restoreTemporaryData()) {
// clear
@@ -208,13 +206,13 @@ export class EditEventPage implements OnInit {
dateEnd: new FormControl(this.dateEnd, [
Validators.required
]),
dateOccurrence: new FormControl(this.dateOccurrence, [
dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type, [
Validators.required
]),
participantes: new FormControl(this.taskParticipants, [
// Validators.required
]),
Date: new FormControl( new Date(this.dateControlStart.value).toLocaleString() < new Date(this.dateControlEnd.value).toLocaleString()? 'ok': null,[
Date: new FormControl( new Date(this.dateControlStart.value).toLocaleString('pt') < new Date(this.dateControlEnd.value).toLocaleString('pt')? 'ok': null,[
Validators.required
]),
@@ -364,7 +362,6 @@ export class EditEventPage implements OnInit {
if (this.postEvent) {
this.postEvent.StartDate = this.dateStart
this.postEvent.EndDate = this.dateEnd
this.postEvent.EventRecurrence.LastOccurrence = this.dateOccurrence
}
}