Merge branch 'feature/placeholder-date' into develop

This commit is contained in:
Eudes Inácio
2022-07-15 10:13:39 +01:00
8 changed files with 22 additions and 53 deletions
@@ -117,9 +117,9 @@
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs materia-top" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
<mat-form-field class="date-hour-picker">
<mat-form-field appearance="none" class="date-hour-picker">
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Choose a date"
placeholder="Data Inicio*"
[(ngModel)]="postEvent.StartDate"
[disabled]="disabled"
[min]="currentDate"
@@ -149,9 +149,9 @@
-->
<div (click)="openFim()" class="ion-input-class flex-grow-1 justify-center align-center materia-top" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
<mat-form-field class="date-hour-picker">
<mat-form-field appearance="none" class="date-hour-picker">
<input matInput [ngxMatDatetimePicker]="fim"
placeholder="Choose a date"
placeholder="Data de fim*"
[(ngModel)]="postEvent.EndDate"
[disabled]="disabled"
[min]="currentDate"
@@ -104,21 +104,6 @@ export class NewEventPage implements OnInit {
this.selectedDate = this.navParams.get('eventSelectedDate');
this.taskParticipants = this.navParams.get('attendees');
let now = new Date();
if(now.getMinutes() <= 30){
this.autoStartTime = new Date(now.setMinutes(30));
this.postEvent.StartDate = this.autoStartTime;
this.autoEndTime = new Date(this.autoStartTime.getTime() + 30 * 60000);
this.postEvent.EndDate = this.autoEndTime;
}
else{
this.autoStartTime = new Date(now.setHours(now.getHours()+1));
this.autoStartTime = new Date(this.autoStartTime.setMinutes(0));
this.postEvent.StartDate = this.autoStartTime;
this.autoEndTime = new Date(this.autoStartTime.getTime() + 30 * 60000);
this.postEvent.EndDate = this.autoEndTime;
}
}
ngOnInit() {
@@ -31,7 +31,7 @@
<ion-datetime
[(ngModel)]="folder.DateBegin"
class="d-block d-md-none"
placeholder="Início"
placeholder="Data início*"
displayFormat="D MMM YYYY H:mm"
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
@@ -41,7 +41,7 @@
<mat-form-field appearance="none" class="date-hour-picker d-none d-md-block">
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Choose a date"
placeholder="Data inicio*"
[formControl]="dateControlStart"
[min]="minDate"
[disabled]="disabled"
@@ -70,7 +70,7 @@
<ion-datetime
class="d-block d-md-none"
[(ngModel)]="folder.DateEnd"
placeholder="Fim"
placeholder="Data de fim*"
displayFormat="D MMM YYYY H:mm"
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
@@ -78,9 +78,9 @@
max="2025">
</ion-datetime>
<mat-form-field class="date-hour-picker d-none d-md-block">
<mat-form-field appearance="none" class="date-hour-picker d-none d-md-block">
<input matInput [ngxMatDatetimePicker]="fim"
placeholder="Choose a date"
placeholder="Data de fim*"
[formControl]="dateControlEnd"
[min]="endMinDate"
[disabled]="disabled"
@@ -75,14 +75,14 @@ export class NewActionPage implements OnInit {
this.dateControlStart = new FormControl(moment(new Date()));
this.dateControlEnd = new FormControl(moment(new Date(new Date().getTime() + 15 * 60000)));
this.folder.DateBegin = new Date().toISOString()
this.folder.DateEnd = (new Date(new Date().getTime() + 15 * 60000)).toISOString()
// this.folder.DateBegin = new Date().toISOString()
// this.folder.DateEnd = (new Date(new Date().getTime() + 15 * 60000)).toISOString()
}
ngOnInit() {
this.segment = "Evento";
this.setDefaultTime()
// this.setDefaultTime()
}
setDefaultTime() {
@@ -123,9 +123,9 @@
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs materia-top" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
<mat-form-field class="date-hour-picker">
<mat-form-field appearance="none" class="date-hour-picker">
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Choose a date"
placeholder="Data Inicio*"
[(ngModel)]="postEvent.StartDate"
[disabled]="disabled"
[min]="currentDate"
@@ -155,9 +155,9 @@
-->
<div (click)="openFim()" class="ion-input-class flex-grow-1 justify-center align-center materia-top" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
<mat-form-field class="date-hour-picker">
<mat-form-field appearance="none" class="date-hour-picker">
<input matInput [ngxMatDatetimePicker]="fim"
placeholder="Choose a date"
placeholder="Data de fim*"
[(ngModel)]="postEvent.EndDate"
[disabled]="disabled"
[min]="currentDate"
@@ -133,22 +133,6 @@ export class NewEventPage implements OnInit {
this.loggeduser = userService.ValidatedUser;
this.postEvent = new Event();
let now = new Date();
if(now.getMinutes() <= 30) {
this.autoStartTime = new Date(now.setMinutes(30));
this.postEvent.StartDate = this.autoStartTime;
this.autoEndTime = new Date(this.autoStartTime.getTime() + 30 * 60000);
this.postEvent.EndDate = this.autoEndTime;
}
else {
this.autoStartTime = new Date(now.setHours(now.getHours()+1));
this.autoStartTime = new Date(this.autoStartTime.setMinutes(0));
this.postEvent.StartDate = this.autoStartTime;
this.autoEndTime = new Date(this.autoStartTime.getTime() + 30 * 60000);
this.postEvent.EndDate = this.autoEndTime;
}
}
ngOnInit() {
@@ -41,9 +41,9 @@
</ion-datetime>
<mat-form-field appearance="none" class="width-100 date-hour-picker d-md-block">
<mat-form-field appearance="none" class="width-100 date-hour-picker d-md-block">
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Choose a date*"
placeholder="Data inicio*"
[(ngModel)]="folder.DateBegin"
[disabled]="disabled"
[min]="currentDate"
@@ -80,12 +80,12 @@
<mat-form-field appearance="none" class="width-100 date-hour-picker d-md-block">
<input matInput [ngxMatDatetimePicker]="picker2"
placeholder="Choose a date*"
placeholder="Data de fim*"
[(ngModel)]="folder.DateEnd"
[disabled]="disabled"
[min]="currentDate"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker2"></mat-datepicker-toggle>
<mat-datepicker-toggle id="new-fim" matSuffix [for]="picker2"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker2
[showSpinners]="showSpinners"
[showSeconds]="showSeconds"
@@ -45,10 +45,10 @@ export class NewActionPage implements OnInit {
this.folder = new PublicationFolder();
this.folder = Object.assign(this.folder, {
/* this.folder = Object.assign(this.folder, {
DateBegin: new Date().toISOString(),
DateEnd: (new Date(new Date().getTime() + 15 * 60000)).toISOString(),
})
}) */
}