This commit is contained in:
Peter Maquiran
2021-07-01 14:54:54 +01:00
parent c5497f26d3
commit 003a3d6ff1
6 changed files with 27 additions and 26 deletions
@@ -94,7 +94,7 @@ export class NewEventPage implements OnInit {
@ViewChild('inicio') inicio: any;
@ViewChild('picker1') picker1: any;
Form: any = {}
Form: FormGroup;
validateFrom = false
@@ -125,11 +125,8 @@ export class NewEventPage implements OnInit {
private modalController: ModalController,
private eventService: EventsService,
private attachmentsService: AttachmentsService,
private animationController: AnimationController,
private toastService: ToastService,
private userService: AuthService,
private http: HttpClient,
private zone: NgZone,
private dateAdapter: DateAdapter<any>,
// private translate: TranslateService
) {
@@ -237,7 +234,7 @@ export class NewEventPage implements OnInit {
this.Form = new FormGroup({
Subject: new FormControl(this.postEvent.Subject, [
Validators.required,
Validators.minLength(4)
// Validators.minLength(4)
]),
Location: new FormControl(this.postEvent.Location, [
Validators.required,
@@ -255,16 +252,13 @@ export class NewEventPage implements OnInit {
IsRecurring: new FormControl(this.postEvent.IsRecurring, [
Validators.required
]),
participantes: new FormControl(this.participantes, [
participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [
Validators.required
]),
})
}
get participantes() {
return this.taskParticipantsCc.concat(this.taskParticipants)
}
openInicio() {
let input: any = document.querySelector('#new-inicio')
@@ -327,10 +321,10 @@ export class NewEventPage implements OnInit {
async save() {
this.injectValidation()
this.runValidation()
// dont runt this function
// if (!this.Form.valid) return false
if(this.Form.invalid) return false
this.getDatepickerData()