This commit is contained in:
Peter Maquiran
2023-02-06 18:48:50 +01:00
parent 2d0f23749c
commit 43634e86ec
4 changed files with 22 additions and 24 deletions
@@ -64,6 +64,7 @@
placeholder="Data de fim*"
[formControl]="dateControlEnd"
[disabled]="disabled"
[min]="dateControlStart.value"
>
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim" ></mat-datepicker-toggle>
<ngx-mat-datetime-picker #fim
@@ -48,8 +48,8 @@ export class NewActionPage implements OnInit {
public stepHour = 1;
public stepMinute = 15;
public stepSecond = 5;
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
public dateControlStart
public dateControlEnd
currentDate = new Date();
showLoader = false
@@ -72,11 +72,9 @@ export class NewActionPage implements OnInit {
this.folder = new PublicationFolder();
this.dateControlStart = new FormControl(moment(new Date()));
this.dateControlEnd = new FormControl(moment(new Date(new Date().getTime() + 15 * 60000)));
this.dateControlStart = new FormControl(this.roundTimeQuarterHour());
this.dateControlEnd = new FormControl(this.dateControlStart.value);
// this.dateControlStart.value = new Date().toISOString()
// this.dateControlEnd.value = (new Date(new Date().getTime() + 15 * 60000)).toISOString()
}
@@ -140,11 +138,11 @@ export class NewActionPage implements OnInit {
try {
await this.publication.CreatePublicationFolder(this.folder).toPromise();
this.toastService.successMessage("Ação presidencial criado");
this.toastService._successMessage("Acção criada");
this.close();
} catch (error) {
this.toastService.badRequest("Ação presidencial não criado");
this.toastService._badRequest("Acção não criada");
} finally {
loader.remove()
}
@@ -179,11 +177,4 @@ export class NewActionPage implements OnInit {
return date
}
setStartDate(){
this.dateControlStart = new FormControl(moment(this.roundTimeQuarterHour() as any));
}
setEndDate(){
this.dateControlEnd = this.dateControlStart;
}
}