This commit is contained in:
Peter Maquiran
2023-08-08 09:43:26 +01:00
parent 834840fc41
commit 67a69d2e47
27 changed files with 153 additions and 54 deletions
@@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { ModalController } from '@ionic/angular';
import * as moment from 'moment';
import { PublicationFolder } from 'src/app/models/publicationfolder';
import { PublicationsService } from 'src/app/services/publications.service';
import { ToastService } from 'src/app/services/toast.service';
@@ -56,11 +55,11 @@ export class NewActionPage implements OnInit {
showLoader = false
get dateStart () {
return this.dateControlStart.value
return this.dateControlStart
}
get dateEnd () {
return this.dateControlEnd.value
return this.dateControlEnd
}
constructor(
@@ -74,8 +73,8 @@ export class NewActionPage implements OnInit {
this.folder = new PublicationFolder();
this.dateControlStart = new FormControl(this.roundTimeQuarterHour());
this.dateControlEnd = new FormControl(this.roundTimeQuarterHourPlus15(this.dateControlStart.value));
this.dateControlStart = this.roundTimeQuarterHour()
this.dateControlEnd = this.roundTimeQuarterHourPlus15(this.dateControlStart)
}
@@ -96,7 +95,7 @@ export class NewActionPage implements OnInit {
runValidation() {
this.validateFrom = true;
if(new Date(this.dateControlStart.value).getTime() > new Date(this.dateControlEnd.value).getTime()){
if(new Date(this.dateControlStart).getTime() > new Date(this.dateControlEnd).getTime()){
this.toastService._badRequest("A data de início não pode ser superior a data de fim");
}
}
@@ -108,7 +107,7 @@ export class NewActionPage implements OnInit {
Validators.required,
// Validators.minLength(4)
]),
Date: new FormControl(this.dateValid, [
Date: new FormControl( this.dateValid,[
Validators.required
]),
Detail: new FormControl(this.folder.Detail, [
@@ -129,8 +128,8 @@ export class NewActionPage implements OnInit {
ProcessId: null,
Description: this.folder.Description,
Detail: this.folder.Detail,
DateBegin: this.dateControlStart.value,
DateEnd: this.dateControlEnd.value,
DateBegin: this.dateControlStart,
DateEnd: this.dateControlEnd,
ActionType: this.segment,
}