diff --git a/src/app/shared/agenda/new-event/new-event.page.ts b/src/app/shared/agenda/new-event/new-event.page.ts
index ac1a39b50..3165b9005 100644
--- a/src/app/shared/agenda/new-event/new-event.page.ts
+++ b/src/app/shared/agenda/new-event/new-event.page.ts
@@ -93,6 +93,7 @@ export class NewEventPage implements OnInit {
@ViewChild('picker') picker: any;
@ViewChild('fim') fim: any;
@ViewChild('inicio') inicio: any;
+ @ViewChild('occurrence') occurrence: any;
@ViewChild('picker1') picker1: any;
Form: FormGroup;
@@ -111,6 +112,7 @@ export class NewEventPage implements OnInit {
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
+ public dateControlOccurrence = new FormControl(moment("DD MM YYYY hh"));
showLoader = false
@@ -122,6 +124,10 @@ export class NewEventPage implements OnInit {
return this.dateControlEnd.value
}
+ get dateOccurrence () {
+ return this.dateControlOccurrence.value
+ }
+
constructor(
private modalController: ModalController,
private eventService: EventsService,
@@ -251,6 +257,9 @@ export class NewEventPage implements OnInit {
dateEnd: new FormControl(this.dateEnd, [
Validators.required
]),
+ dateOccurrence: new FormControl(this.dateOccurrence, [
+ Validators.required
+ ]),
IsRecurring: new FormControl(this.postEvent.IsRecurring, [
Validators.required
]),
@@ -277,6 +286,13 @@ export class NewEventPage implements OnInit {
}
}
+ openLastOccurrence() {
+ let input: any = document.querySelector('#last-occurrence')
+ if(input) {
+ input.click()
+ }
+ }
+
async getDoc(){
const modal = await this.modalController.create({
component: SearchPage,
@@ -328,6 +344,7 @@ export class NewEventPage implements OnInit {
if (this.postEvent) {
this.postEvent.StartDate = this.dateStart
this.postEvent.EndDate = this.dateEnd
+ this.postEvent.EventRecurrence.LastOccurrence = this.dateOccurrence
}
}