add ocurrence

This commit is contained in:
Peter Maquiran
2021-08-06 11:35:05 +01:00
parent 22911bf88e
commit 08c749e46c
2 changed files with 76 additions and 39 deletions
@@ -35,7 +35,6 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
}
}
@Component({
selector: 'app-book-meeting-modal',
templateUrl: './book-meeting-modal.page.html',
@@ -69,6 +68,9 @@ export class BookMeetingModalPage implements OnInit {
Form: FormGroup;
validateFrom = false
recurringTypes = [];
Occurrence: Date = new Date()
EventRecurrenceType = '-1'
showLoader = false
@@ -154,8 +156,17 @@ export class BookMeetingModalPage implements OnInit {
console.log(this.task);
this.getAttachments();
this.setDefaultTime()
this.getRecurrenceTypes();
}
getRecurrenceTypes() {
this.calendarService.getRecurrenceTypes().subscribe(res=>{
this.recurringTypes = res;
});
}
setDefaultTime() {
this.postData.StartDate = new Date()
this.postData.EndDate = (new Date(new Date().getTime() + 15 * 60000))
@@ -220,9 +231,8 @@ export class BookMeetingModalPage implements OnInit {
if(this.loggeduser.Profile == 'MDGPR') {
this.injectValidation()
this.runValidation()
if(this.Form.invalid) return false
}
// if(this.Form.invalid) return false
let Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
@@ -248,7 +258,10 @@ export class BookMeetingModalPage implements OnInit {
Organizer: null,
Category: 'Reunião',
HasAttachments: true,
EventRecurrence: null,
EventRecurrence: {
Type: this.EventRecurrenceType,
LastOccurrence: this.Occurrence
},
}
console.log(this.postData);
@@ -339,6 +352,13 @@ export class BookMeetingModalPage implements OnInit {
}
}
openLastOccurrence() {
let input: any = document.querySelector('#last-occurrence')
if(input) {
input.click()
}
}
async addParticipantsCc() {
this.adding = "CC";