mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
New changes added + AddEvent method partially done
This commit is contained in:
@@ -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(){
|
||||
|
||||
Reference in New Issue
Block a user