New changes added + AddEvent method partially done

This commit is contained in:
Tiago Kayaya
2020-08-20 14:28:50 +01:00
parent ffa9ecd1fe
commit 65c4cabcbf
24 changed files with 418 additions and 170 deletions
+31 -14
View File
@@ -1,6 +1,9 @@
import { Component, OnInit, AfterViewInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { Event } from '../../models/event.model';
import { EventsService } from 'src/app/services/events.service';
@Component({
selector: 'app-cal-modal',
templateUrl: './cal-modal.page.html',
@@ -15,22 +18,31 @@ export class CalModalPage implements AfterViewInit {
viewTitle: string;
event = {
title: '',
desc: '',
place: '',
people: '',
group: '',
type: '',
frequency: '',
startTime: null,
endTime: null,
allDay: true
public postEvent: Event = {
EventId: '',
Subject: '',
Body: null,
Location: '',
CalendarId: '',
CalendarName: '',
StartDate: '',
EndDate: '',
EventType: '',
RequiredAttendees: null,
OptionalAttendees: null,
HasAttachments: false,
IsMeeting: false,
IsRecurring: false,
AppointmentState: 0,
TimeZone: '',
Organizer: '',
Categories: null,
Attachments: null,
};
modalReady = false;
constructor(private modalCtrl: ModalController) { }
constructor(private modalCtrl: ModalController, private eventService: EventsService) { }
ngOnInit() {
}
@@ -42,7 +54,11 @@ export class CalModalPage implements AfterViewInit {
}
save(){
this.modalCtrl.dismiss({event: this.event})
this.modalCtrl.dismiss({postEvent: this.eventService.AddEvent(this.postEvent)});
/* this.eventService.AddEvent(); */
console.log("created");
}
onViewTitleChanged(title){
@@ -50,7 +66,8 @@ export class CalModalPage implements AfterViewInit {
}
onTimeSelected(ev){
this.event.startTime = new Date(ev.selectedTime);
/* this.postEvent.startTime = new Date(ev.selectedTime); */
}
close(){