mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
remove all date
This commit is contained in:
@@ -226,6 +226,7 @@ export class NewEventPage implements OnInit {
|
||||
_date .setMinutes(minutes + 15)
|
||||
return _date
|
||||
}
|
||||
|
||||
setStartDate() {
|
||||
if(!this.postEvent.StartDate) {
|
||||
this.postEvent.StartDate = this.roundTimeQuarterHour();
|
||||
|
||||
@@ -10,6 +10,21 @@ import { SearchPage } from './search.page';
|
||||
import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.module';
|
||||
/* */
|
||||
/* import { TagCloudModule } from 'angular-tag-cloud-module'; */
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
|
||||
import { MatNativeDateModule } from '@angular/material/core';
|
||||
|
||||
import {
|
||||
NgxMatDatetimePickerModule,
|
||||
NgxMatNativeDateModule,
|
||||
NgxMatTimepickerModule
|
||||
} from '@angular-material-components/datetime-picker';
|
||||
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { NgxMatMomentModule } from '@angular-material-components/moment-adapter';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -20,6 +35,16 @@ import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-
|
||||
/* */
|
||||
SearchPageRoutingModule,
|
||||
BtnModalDismissPageModule,
|
||||
NgxMatDatetimePickerModule,
|
||||
NgxMatNativeDateModule,
|
||||
NgxMatTimepickerModule,
|
||||
NgxMatMomentModule,
|
||||
MatDatepickerModule,
|
||||
MatInputModule,
|
||||
MatNativeDateModule,
|
||||
ReactiveFormsModule,
|
||||
MatButtonModule,
|
||||
MatSelectModule
|
||||
],
|
||||
declarations: [SearchPage],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
|
||||
@@ -59,18 +59,37 @@
|
||||
</div>
|
||||
</div>
|
||||
</ion-form>
|
||||
|
||||
<!-- -->
|
||||
<li *ngIf="showAdvanceSearch" class="d-flex date-container ion-justify-content-between">
|
||||
<div class="icon-mer icon">
|
||||
<ion-icon name="restaurant-outline" src="assets/images/icons-advance-search-document.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="input-container d-flex ion-align-items-">
|
||||
<ion-datetime class="cursor-pointer" [(ngModel)]='searchDocumentDate' placeholder="Data" display-timezone="utc"></ion-datetime>
|
||||
<div class="input-container d-flex flex-grow-1 justify-center align-center materia-top">
|
||||
|
||||
<mat-form-field appearance="none" class="date-hour-picker" (click)="clickDate()" style="
|
||||
margin-top: -11px;
|
||||
margin-left: 10px;
|
||||
">
|
||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||
placeholder="Data Inicio*"
|
||||
[(ngModel)]="searchDocumentDate"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1" (click)="clickDate()" ></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #picker1 (click)="clickDate()"
|
||||
[showSpinners]="showSpinners"
|
||||
[showSeconds]="showSeconds"
|
||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||
[stepSecond]="stepSecond"
|
||||
[touchUi]="touchUi"
|
||||
>
|
||||
</ngx-mat-datetime-picker>
|
||||
</mat-form-field>
|
||||
|
||||
<div class="icon cursor-pointer" (click)="clearInputDocumentDate()">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " name="restaurant-outline" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<!-- Sender -->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { SearchService } from "../../services/search.service";
|
||||
import { formatDate } from '@angular/common';
|
||||
@@ -14,14 +14,40 @@ import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.pag
|
||||
import { Router } from '@angular/router';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
dateInput: "YYYY-MMMM-DD HH:mm"
|
||||
},
|
||||
display: {
|
||||
dateInput: "DD MMM YYYY H:mm",
|
||||
monthYearLabel: "MMM YYYY",
|
||||
dateA11yLabel: "LL",
|
||||
monthYearA11yLabel: "MMMM YYYY"
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-search',
|
||||
templateUrl: './search.page.html',
|
||||
styleUrls: ['./search.page.scss'],
|
||||
providers: [
|
||||
{ provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATE_FORMATS },
|
||||
]
|
||||
})
|
||||
export class SearchPage implements OnInit {
|
||||
|
||||
public showSpinners = true;
|
||||
public showSeconds = false;
|
||||
public touchUi = false;
|
||||
public enableMeridian = false;
|
||||
public stepHour = 1;
|
||||
public stepMinute = 15;
|
||||
public stepSecond = 15;
|
||||
//
|
||||
|
||||
// https params
|
||||
searchSubject: string;
|
||||
searchDocumentDate: string;
|
||||
@@ -61,6 +87,9 @@ export class SearchPage implements OnInit {
|
||||
|
||||
showSearchInput = false
|
||||
|
||||
|
||||
@ViewChild('picker1') picker1: any;
|
||||
|
||||
constructor(private modalController: ModalController,
|
||||
private search: SearchService,
|
||||
private modalCtrl: ModalController,
|
||||
@@ -213,6 +242,38 @@ export class SearchPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
roundTimeQuarterHour(timeToReturn = new Date()) {
|
||||
let date: any = new Date(timeToReturn) || new Date();
|
||||
const minutes = date.getMinutes();
|
||||
date.setSeconds(0);
|
||||
|
||||
if(minutes % 15 != 0) {
|
||||
|
||||
if (minutes > 45) {
|
||||
date.setMinutes(60)
|
||||
} else if (minutes > 30) {
|
||||
date.setMinutes(45)
|
||||
} else if (minutes > 15) {
|
||||
date.setMinutes(30)
|
||||
} else if (minutes > 0) {
|
||||
date.setMinutes(15)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return date
|
||||
}
|
||||
|
||||
clickDate() {
|
||||
if(!this.searchDocumentDate) {
|
||||
this.searchDocumentDate = this.roundTimeQuarterHour()
|
||||
}
|
||||
}
|
||||
|
||||
clearInputDocumentDate() {
|
||||
this.searchDocumentDate = "";
|
||||
}
|
||||
|
||||
loadWordCloud() {
|
||||
|
||||
setTimeout(() => {
|
||||
@@ -720,9 +781,7 @@ export class SearchPage implements OnInit {
|
||||
this.searchSender = "";
|
||||
}
|
||||
|
||||
clearInputDocumentDate(){
|
||||
this.searchDocumentDate = "";
|
||||
}
|
||||
|
||||
|
||||
clearInputOrganicEntity(){
|
||||
this.searchOrganicEntiry = "";
|
||||
|
||||
Reference in New Issue
Block a user