Changes on Intervenientes + New Event

This commit is contained in:
Tiago Kayaya
2020-09-04 01:25:32 +01:00
parent b9a70fecb8
commit d82271ae37
13 changed files with 181 additions and 126 deletions
+77 -9
View File
@@ -1,5 +1,5 @@
import { Component, OnInit, AfterViewInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { Component, OnInit, AfterViewInit, Input } from '@angular/core';
import { ModalController, NavParams } from '@ionic/angular';
import { Event } from '../../models/event.model';
import { EventsService } from 'src/app/services/events.service';
@@ -9,6 +9,7 @@ import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page';
import { AttendeeModalPage } from '../events/attendee-modal/attendee-modal.page';
import { EventPerson } from 'src/app/models/eventperson.model';
import { AlertService } from 'src/app/services/alert.service';
import { moveMessagePortToContext } from 'worker_threads';
@Component({
selector: 'app-cal-modal',
@@ -22,20 +23,84 @@ export class CalModalPage implements OnInit {
currentDate: new Date()
};
viewTitle: string;
postEvent: Event;
modalReady = false;
eventAttendees: EventPerson[];
segment:string = "true";
selectedSegment: string;
selectedDate: Date;
constructor(private modalCtrl: ModalController, private eventService: EventsService, private alertController:AlertService) {
viewTitle: string;
postEvent: Event;
eventBody: EventBody;
modalReady = false;
minDate: string;
@Input() teste: string;
passedInfo = null;
constructor(private modalCtrl: ModalController, private eventService: EventsService, private alertController:AlertService,
private navParams: NavParams) {
this.postEvent = new Event();
this.postEvent.Body = { BodyType : "1", Text : ""};
this.eventBody = { BodyType : "1", Text : ""};
this.postEvent.Body = this.eventBody;
}
ngOnInit() {
this.selectedSegment = this.navParams.get('segment');
this.selectedDate = this.navParams.get('eventSelectedDate');
let selectedStartdDate = this.selectedDate;
let selectedEndDate = new Date(this.selectedDate);
/* Set + 30minutes to seleted datetime */
selectedEndDate.setMinutes(this.selectedDate.getMinutes() + 30)
this.minDate = this.selectedDate.toString();
if(this.selectedSegment != "Combinada"){
this.postEvent ={
EventId: '',
Subject: '',
Body: this.eventBody,
Location: '',
CalendarId: '',
CalendarName: this.selectedSegment,
StartDate: selectedStartdDate,
EndDate: new Date(selectedEndDate),
EventType: '',
Attendees: null,
IsMeeting: false,
IsRecurring: false,
AppointmentState: 0,
TimeZone: '',
Organizer: '',
Categories: null,
HasAttachments: false,
};
}
else{
this.postEvent ={
EventId: '',
Subject: '',
Body: this.eventBody,
Location: '',
CalendarId: '',
CalendarName: '',
StartDate: selectedStartdDate,
EndDate: new Date(selectedEndDate),
EventType: '',
Attendees: null,
IsMeeting: false,
IsRecurring: false,
AppointmentState: 0,
TimeZone: '',
Organizer: '',
Categories: null,
HasAttachments: false,
};
}
}
ngAfterViewInit(): void {
@@ -126,5 +191,8 @@ export class CalModalPage implements OnInit {
}
});
}
example(){
console.log("Mensagem");
}
}