This commit is contained in:
Eudes Inácio
2022-06-14 10:12:26 +01:00
13 changed files with 55 additions and 12 deletions
@@ -22,13 +22,14 @@ export class EditActionPage implements OnInit {
public showSeconds = false;
public touchUi = false;
public enableMeridian = false;
public minDate = new Date().toISOString().slice(0,10)
public minDate = new Date().toISOString()
public maxDate: any;
public stepHour = 1;
public stepMinute = 5;
public stepSecond = 5;
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
currentDate = new Date();
folder: PublicationFolder;
folderId: string;
@@ -64,8 +65,15 @@ export class EditActionPage implements OnInit {
}
get dateValid() {
var validado: boolean;
if (window.innerWidth <= 800) {
return this.folder.DateBegin < this.folder.DateEnd? ['ok']: []
if ((this.folder.DateBegin < this.folder.DateEnd) && (new Date(this.folder.DateBegin).getTime() > this.currentDate.getTime())) {
validado = true;
}else{
validado = false;
}
return validado == true ? ['ok']: [];
} else {
return ['ok']
}
@@ -89,6 +97,11 @@ export class EditActionPage implements OnInit {
}
async save() {
this.injectValidation()
this.runValidation()
if(this.Form.invalid) return false
let body = {
ProcessId: this.folderId,
Description: this.folder.Description,
@@ -43,13 +43,14 @@ export class NewActionPage implements OnInit {
public showSeconds = false;
public touchUi = false;
public enableMeridian = false;
public minDate = new Date().toISOString().slice(0,10)
public minDate = new Date().toISOString()
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
public stepHour = 1;
public stepMinute = 5;
public stepSecond = 5;
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
currentDate = new Date();
showLoader = false
@@ -94,8 +95,15 @@ export class NewActionPage implements OnInit {
}
get dateValid() {
var validado: boolean;
if (window.innerWidth <= 800) {
return this.folder.DateBegin < this.folder.DateEnd? ['ok']: []
if ((this.folder.DateBegin < this.folder.DateEnd) && (new Date(this.folder.DateBegin).getTime() > this.currentDate.getTime())) {
validado = true;
}else{
validado = false;
}
return validado == true ? ['ok']: [];
} else {
return ['ok']
}
@@ -401,6 +401,7 @@ export class PublicationsPage implements OnInit {
goBackToViewPublications() {
this.closeDesktopComponent();
this.idSelected = this.folderId;
this.desktopComponent.showViewPublication = true;
}
@@ -408,6 +409,7 @@ export class PublicationsPage implements OnInit {
// Emitters
goBackToPubications() {
this.closeDesktopComponent();
this.idSelected = this.folderId;
this.desktopComponent.showViewPublication = true;
}
@@ -429,6 +431,7 @@ export class PublicationsPage implements OnInit {
// edit publication will send null
if (folderId != undefined) {
this.folderId = folderId;
this.idSelected = this.folderId;
}
this.publication = publication;
@@ -437,6 +440,7 @@ export class PublicationsPage implements OnInit {
async editPublication(foolderId: string) {
this.closeDesktopComponent();
this.idSelected = this.folderId;
this.desktopComponent.showEditActions = true;
}
@@ -445,6 +449,7 @@ export class PublicationsPage implements OnInit {
this.publicationId = publicationId;
this.closeDesktopComponent();
this.idSelected = this.folderId;
this.desktopComponent.showPublicationDetail = true;
}