add validation to date in new event

This commit is contained in:
tiago.kayaya
2021-12-13 15:34:16 +01:00
parent 3ab9d3445d
commit e524062ed9
6 changed files with 16 additions and 12 deletions
@@ -180,7 +180,10 @@ export class NewEventPage implements OnInit {
runValidation() {
this.validateFrom = true
this.validateFrom = true;
if(new Date(this.postEvent.StartDate).getTime() > new Date(this.postEvent.EndDate).getTime()){
this.toastService._badRequest("A data de fim não pode ser inferior a data de início do evento")
}
}
@@ -316,14 +319,14 @@ export class NewEventPage implements OnInit {
const newAttendees: EventPerson[] = data['taskParticipants'];
const newAttendeesCC: EventPerson[] = data['taskParticipantsCc'];
if(newAttendees.length) {
this.setIntervenient(newAttendees);
}
if(newAttendeesCC) {
this.setIntervenientCC(newAttendeesCC);
}
}
}