diff --git a/src/app/pages/agenda/view-event/view-event.page.ts b/src/app/pages/agenda/view-event/view-event.page.ts index 406312249..4d7378c27 100644 --- a/src/app/pages/agenda/view-event/view-event.page.ts +++ b/src/app/pages/agenda/view-event/view-event.page.ts @@ -109,16 +109,20 @@ export class ViewEventPage implements OnInit { }); } - loadEvent(){ + loadEvent() { const loader = this.toastService.loading(); this.eventsService.getEvent(this.eventId).subscribe(res => { this.loadedEvent = res; - - console.log(res); - /* this.today = new Date(res.StartDate); this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */ loader.remove() + }, ()=>{ + + loader.remove() + this.toastService.badRequest('Este evento já não existe na sua agenda') + this.modalController.dismiss('Eevent not Foud'); + this.router.navigate(['/home/agenda']); + }); } diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts index b23d7951f..ad25f1dfc 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -14,6 +14,7 @@ import { Camera, CameraOptions } from '@ionic-native/camera/ngx'; import { ToastService } from 'src/app/services/toast.service'; import { FormControl, FormGroup, Validators } from '@angular/forms'; import { ThemePalette } from '@angular/material/core'; +import { formatDate } from 'src/plugin/momentG.js' @Component({ selector: 'app-new-publication', @@ -218,14 +219,16 @@ export class NewPublicationPage implements OnInit { } else { - + const date = formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss') + alert(date) + this.publication = { - DateIndex: new Date(), + DateIndex: date, DocumentId:null, ProcessId:this.folderId, Title: this.pub.Title, Message: this.pub.Message, - DatePublication: new Date(), + DatePublication: date, OriginalFileName: this.capturedImageTitle, FileBase64: this.capturedImage, FileExtension: 'jpeg', diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 2dc6c80a3..05567c79b 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -35,7 +35,7 @@