This commit is contained in:
Peter Maquiran
2022-04-06 14:51:35 +01:00
parent 5570b07ddf
commit d0d920f80b
5 changed files with 54 additions and 43 deletions
@@ -122,29 +122,29 @@ export class ViewEventPage implements OnInit {
});
} else {
const event = this.CalendarService.eventSource.find((ele) => ele.id == this.eventId)
this.eventsService.genericGetEvent(this.eventId, this.loadedEvent.CalendarId).subscribe(res => {
this.loadedEvent = res;
this.today = new Date(res.StartDate);
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
}, (error)=> {
this.viewEventDetailDismiss.emit({
type: 'close'
})
if(error.status == 0) {
this.toastService.badRequest('Não é possível visualizar este evento no modo offline')
} else {
this.toastService.badRequest('Este evento já não existe na sua agenda')
}
});
if(event?.CalendarId) {
this.eventsService.genericGetEvent(this.eventId, event.CalendarId).subscribe(res => {
this.loadedEvent = res;
this.today = new Date(res.StartDate);
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
}, (error)=> {
this.viewEventDetailDismiss.emit({
type: 'close'
})
if(error.status == 0) {
this.toastService.badRequest('Não é possível visualizar este evento no modo offline')
} else {
this.toastService.badRequest('Este evento já não existe na sua agenda')
}
});
}
}
}