mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
improve
This commit is contained in:
+2
-2
@@ -147,7 +147,7 @@
|
||||
[min]="minDate"
|
||||
[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"
|
||||
@@ -186,7 +186,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"
|
||||
|
||||
+43
-1
@@ -59,7 +59,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
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"));
|
||||
@@ -481,4 +481,46 @@ export class BookMeetingModalPage implements OnInit {
|
||||
this.taskParticipantsCc = data;
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
// console.log("AFTER IF MINUTES: " +m);
|
||||
// console.log("AFTER HOURS: " +h);
|
||||
|
||||
return timeToReturn;
|
||||
}
|
||||
|
||||
setStartDate(){
|
||||
this.postData.StartDate = this.roundTimeQuarterHour();
|
||||
}
|
||||
|
||||
setEndDate(){
|
||||
this.postData.EndDate = this.postData.StartDate;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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"));
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -27,19 +27,19 @@
|
||||
|
||||
<div class="btn-modal-dismiss" *ngIf="showSearchInput">
|
||||
<button class="btn-no-color" (click)="close()">
|
||||
<ion-icon c*ngIf="ThemeService.currentTheme == 'default' " lass="icon" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "class="icon" src="assets/images/icons-search-close.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Search drop down -->
|
||||
<div class="advance-search pa-0 pt-10 pr-10 flex-md-grow-1" >
|
||||
|
||||
<div class="advance-search pa-0 pt-10 pr-10 flex-md-grow-1" >
|
||||
<ion-form [class.d-none]="!showSearchInput">
|
||||
<div class="d-flex search-input-container ion-justify-content-between" >
|
||||
<div class="icon">
|
||||
<button class="btn-no-color" (click)="basicSearch()">
|
||||
<ion-icon class="icon-z" slot="end" name="search"></ion-icon>
|
||||
<ion-icon class="icon-z" slot="end" src="assets/images/theme/gov/search.svg"></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="input-text d-flex ion-align-items-center">
|
||||
@@ -102,7 +102,14 @@
|
||||
<div class="container ">
|
||||
<div class="d-flex overflow-x-auto">
|
||||
<!-- SLIDE -->
|
||||
<div *ngFor="let category of searchCategories; index as i;" class="d-flex py-10" style="width:0px" [ngClass]="{'active-category': category.Active}" class="button cursor-pointer" (click)="filterDocList(category.Name)" (click)="activeCategoty(i)">
|
||||
|
||||
<div class="d-flex py-10" style="width:0px" [ngClass]="{'active-category': TodosCategory}" class="button cursor-pointer" (click)="noFilter()">
|
||||
|
||||
<span>Todos</span>
|
||||
<ion-label class="label">{{ searchDocuments.length }}</ion-label>
|
||||
</div>
|
||||
|
||||
<div *ngFor="let category of searchCategories; index as i;" class="d-flex py-10" style="width:0px" [ngClass]="{'active-category': category.Active}" class="button cursor-pointer" (click)="activeCategoty(i); filterDocList(category.Name)">
|
||||
|
||||
<span>{{ category.Name }}</span>
|
||||
<ion-label class="label">{{ category.Qtd }}</ion-label>
|
||||
|
||||
@@ -704,6 +704,7 @@ export class SearchPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
TodosCategory = true
|
||||
async filterDocList(categoryName:string){
|
||||
|
||||
// show all category
|
||||
@@ -716,6 +717,27 @@ export class SearchPage implements OnInit {
|
||||
}
|
||||
|
||||
this.showCategory = categoryName;
|
||||
|
||||
for(let category of this.searchCategories) {
|
||||
if(category['Active']) {
|
||||
this.TodosCategory = false
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
this.TodosCategory = true
|
||||
|
||||
}
|
||||
|
||||
|
||||
noFilter() {
|
||||
this.TodosCategory = true
|
||||
let n = 0
|
||||
for(let category of this.searchCategories) {
|
||||
this.searchCategories[n]['Active'] = false
|
||||
n++
|
||||
}
|
||||
this.showSearchDocuments = this.searchDocuments;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user