mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
merge
This commit is contained in:
@@ -25,7 +25,7 @@ export class EditActionPage implements OnInit {
|
||||
public minDate = new Date().toISOString()
|
||||
public maxDate: any;
|
||||
public stepHour = 1;
|
||||
public stepMinute = 5;
|
||||
public stepMinute = 15;
|
||||
public stepSecond = 5;
|
||||
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
|
||||
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
[formControl]="dateControlStart"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1" (click)="setStartDate()"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #picker1
|
||||
[showSpinners]="showSpinners"
|
||||
[showSeconds]="showSeconds"
|
||||
@@ -83,7 +83,7 @@
|
||||
[min]="endMinDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
||||
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim" (click)="setEndDate()"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #fim
|
||||
[showSpinners]="showSpinners"
|
||||
[showSeconds]="showSeconds"
|
||||
|
||||
@@ -46,7 +46,7 @@ export class NewActionPage implements OnInit {
|
||||
public minDate = new Date().toISOString()
|
||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
|
||||
public stepHour = 1;
|
||||
public stepMinute = 5;
|
||||
public stepMinute = 15;
|
||||
public stepSecond = 5;
|
||||
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
|
||||
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
|
||||
@@ -98,9 +98,9 @@ export class NewActionPage implements OnInit {
|
||||
var validado: boolean;
|
||||
|
||||
if (window.innerWidth <= 800) {
|
||||
if ((this.folder.DateBegin < this.folder.DateEnd) && (new Date(this.folder.DateBegin).getTime() > this.currentDate.getTime())) {
|
||||
if ((this.folder.DateBegin < this.folder.DateEnd)) {
|
||||
validado = true;
|
||||
}else{
|
||||
} else {
|
||||
validado = false;
|
||||
}
|
||||
return validado == true ? ['ok']: [];
|
||||
@@ -111,8 +111,8 @@ export class NewActionPage implements OnInit {
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true;
|
||||
if(new Date(this.folder.DateBegin).toISOString() > new Date(this.folder.DateEnd).toISOString()){
|
||||
this.toastService.badRequest("A data de início não pode ser superior a data de fim");
|
||||
if(new Date(this.folder.DateBegin).getTime() > new Date(this.folder.DateEnd).getTime()){
|
||||
this.toastService._badRequest("A data de início não pode ser superior a data de fim");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,4 +171,42 @@ export class NewActionPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
|
||||
roundTimeQuarterHour() {
|
||||
var timeToReturn = new Date();
|
||||
var minutes = timeToReturn.getMinutes();
|
||||
var hours = timeToReturn.getHours();
|
||||
|
||||
var m = (Math.round(minutes/15) * 15) % 60;
|
||||
var h = minutes > 52 ? (hours === 23 ? 0 : ++hours) : hours;
|
||||
|
||||
if (m == 0) {
|
||||
if(minutes > m){
|
||||
m = m + 15;
|
||||
}
|
||||
timeToReturn.setHours(h);
|
||||
timeToReturn.setMinutes(m);
|
||||
}else{
|
||||
if(minutes > m) {
|
||||
|
||||
m = m + 15;
|
||||
|
||||
timeToReturn.setHours(h);
|
||||
timeToReturn.setMinutes(m);
|
||||
}else {
|
||||
timeToReturn.setHours(h);
|
||||
timeToReturn.setMinutes(m);
|
||||
}
|
||||
}
|
||||
|
||||
return timeToReturn;
|
||||
}
|
||||
|
||||
setStartDate(){
|
||||
this.dateControlStart = new FormControl(moment(this.roundTimeQuarterHour()));
|
||||
}
|
||||
|
||||
setEndDate(){
|
||||
this.dateControlEnd = this.dateControlStart;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ export class NewPublicationPage implements OnInit {
|
||||
public minDate = new Date().toISOString().slice(0, 10)
|
||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
|
||||
public stepHour = 1;
|
||||
public stepMinute = 5;
|
||||
public stepMinute = 15;
|
||||
public stepSecond = 5;
|
||||
public color: ThemePalette = 'primary';
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<!-- Left -->
|
||||
<div class="aside-left app-default-padding d-flex flex-grow-1 flex-column width-30 ">
|
||||
<!-- Header -->
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader || skeletonLoader"></ion-progress-bar>
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-toolbar >
|
||||
|
||||
<div class="main-header">
|
||||
|
||||
@@ -24,7 +24,7 @@ import { PermissionService } from 'src/app/services/permission.service';
|
||||
styleUrls: ['./publications.page.scss'],
|
||||
})
|
||||
export class PublicationsPage implements OnInit {
|
||||
showLoader: boolean;
|
||||
showLoader: boolean = false
|
||||
publicationFolder: PublicationFolder;
|
||||
publication: Publication;
|
||||
|
||||
@@ -57,7 +57,6 @@ export class PublicationsPage implements OnInit {
|
||||
hideRefreshBtn = true;
|
||||
showSlidingOptions = true;
|
||||
idSelected: string;
|
||||
skeletonLoader: boolean;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
@@ -138,13 +137,10 @@ export class PublicationsPage implements OnInit {
|
||||
return this.theDate.getDate() + " de " + (this.months[this.theDate.getMonth()]) + " de " + this.theDate.getFullYear()
|
||||
}
|
||||
|
||||
loadList = false
|
||||
|
||||
getActions() {
|
||||
if(this.loadList == false) {
|
||||
this.loadList = true
|
||||
if(this.showLoader == false) {
|
||||
this.showLoader = true;
|
||||
this.skeletonLoader = true;
|
||||
this.publications.GetPublicationFolderList().subscribe(async res => {
|
||||
|
||||
const folders: PublicationFolder[] = this.getPublicationFolderMap(res)
|
||||
@@ -162,13 +158,9 @@ export class PublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
this.showLoader = false;
|
||||
this.skeletonLoader = false;
|
||||
this.loadList = false
|
||||
|
||||
}, (error) => {
|
||||
this.showLoader = false;
|
||||
this.skeletonLoader = false;
|
||||
this.loadList = false
|
||||
});
|
||||
}
|
||||
|
||||
@@ -268,8 +260,9 @@ export class PublicationsPage implements OnInit {
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
this.refreshing()
|
||||
}
|
||||
this.refreshing()
|
||||
|
||||
}
|
||||
|
||||
async AddPublicationFolder(item?: any) {
|
||||
|
||||
Reference in New Issue
Block a user