From e6f5ac9c6c175d49cda202c8a58d39f09fb3a930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Thu, 29 Feb 2024 16:07:25 +0100 Subject: [PATCH] bug solve creating action --- .../publication/new-action/new-action.page.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/app/shared/publication/new-action/new-action.page.ts b/src/app/shared/publication/new-action/new-action.page.ts index 21cc28180..dc21531a4 100644 --- a/src/app/shared/publication/new-action/new-action.page.ts +++ b/src/app/shared/publication/new-action/new-action.page.ts @@ -73,7 +73,7 @@ export class NewActionPage implements OnInit { } -/* get dateValid() { + get dateValid() { var validado: boolean; if (window.innerWidth <= 800) { @@ -86,16 +86,19 @@ export class NewActionPage implements OnInit { } else { return ['ok'] } - } */ - - get dateValid() { - return new Date(this.folder.DateBegin).getTime() < new Date(this.folder.DateBegin).getTime() ? 'ok': null } + /* get dateValid() { + return new Date(this.folder.DateBegin).getTime() < new Date(this.folder.DateBegin).getTime() ? 'ok': null + } */ + runValidation() { this.validateFrom = true; - if((new Date(this.folder.DateBegin).getTime()) > (new Date(this.folder.DateEnd).getTime())) { + console.log(this.folder.DateBegin) + console.log(this.folder.DateEnd) + if(this.folder.DateBegin > this.folder.DateEnd) { this.toastService._badRequest("A data de início não pode ser superior a data de fim"); + return false } } @@ -117,13 +120,13 @@ export class NewActionPage implements OnInit { async save() { - + alert('hererr') this.injectValidation() this.runValidation() if(this.Form.invalid) return false - + alert('hererr 222') this.folder = { ProcessId: null,