mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Allday feature added
This commit is contained in:
@@ -144,7 +144,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container-div width-100">
|
<div *ngIf="allDayCheck" class="container-div width-100">
|
||||||
<div class="ion-item-class-2 width-100">
|
<div class="ion-item-class-2 width-100">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
@@ -164,7 +164,9 @@
|
|||||||
[showSeconds]="showSeconds"
|
[showSeconds]="showSeconds"
|
||||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||||
[stepSecond]="stepSecond"
|
[stepSecond]="stepSecond"
|
||||||
[touchUi]="touchUi">
|
[touchUi]="touchUi"
|
||||||
|
[hideTime]="true">
|
||||||
|
|
||||||
</ngx-mat-datetime-picker>
|
</ngx-mat-datetime-picker>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@@ -172,6 +174,66 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="!allDayCheck" class="container-div width-100">
|
||||||
|
<div class="ion-item-class-2 width-100">
|
||||||
|
<div class="ion-icon-class">
|
||||||
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
|
</div>
|
||||||
|
<div class="ion-input-class" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||||
|
|
||||||
|
<mat-form-field appearance="none" floatLabel="never" class="date-hour-picker">
|
||||||
|
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||||
|
placeholder="Choose a date"
|
||||||
|
[(ngModel)]="postEvent.StartDate"
|
||||||
|
[max]="maxDate"
|
||||||
|
[disabled]="disabled"
|
||||||
|
>
|
||||||
|
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||||
|
<ngx-mat-datetime-picker #picker1
|
||||||
|
[showSpinners]="showSpinners"
|
||||||
|
[showSeconds]="showSeconds"
|
||||||
|
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||||
|
[stepSecond]="stepSecond"
|
||||||
|
[touchUi]="touchUi"
|
||||||
|
[hideTime]="false">
|
||||||
|
</ngx-mat-datetime-picker>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div *ngIf="allDayCheck" class="container-div width-100">
|
||||||
|
<div class="ion-item-class-2 width-100 d-flex">
|
||||||
|
<div class="ion-icon-class">
|
||||||
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
|
</div>
|
||||||
|
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||||
|
|
||||||
|
<mat-form-field appearance="none" floatLabel="never" floatLabel="never" class="date-hour-picker">
|
||||||
|
<input matInput [ngxMatDatetimePicker]="fim"
|
||||||
|
placeholder="Choose a date"
|
||||||
|
[(ngModel)]="postEvent.EndDate"
|
||||||
|
[min]="postEvent.StartDate"
|
||||||
|
[max]="maxDate"
|
||||||
|
[disabled]="disabled"
|
||||||
|
>
|
||||||
|
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
||||||
|
<ngx-mat-datetime-picker #fim
|
||||||
|
[showSpinners]="showSpinners"
|
||||||
|
[showSeconds]="showSeconds"
|
||||||
|
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||||
|
[stepSecond]="stepSecond"
|
||||||
|
[hideTime]="true">
|
||||||
|
>
|
||||||
|
</ngx-mat-datetime-picker>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div *ngIf="!allDayCheck" class="container-div width-100">
|
<div *ngIf="!allDayCheck" class="container-div width-100">
|
||||||
<div class="ion-item-class-2 width-100 d-flex">
|
<div class="ion-item-class-2 width-100 d-flex">
|
||||||
@@ -193,7 +255,8 @@
|
|||||||
[showSpinners]="showSpinners"
|
[showSpinners]="showSpinners"
|
||||||
[showSeconds]="showSeconds"
|
[showSeconds]="showSeconds"
|
||||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||||
[stepSecond]="stepSecond">
|
[stepSecond]="stepSecond"
|
||||||
|
[hideTime]="false">
|
||||||
</ngx-mat-datetime-picker>
|
</ngx-mat-datetime-picker>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
|
|||||||
@@ -108,8 +108,6 @@ export class EditEventPage implements OnInit {
|
|||||||
this.isEventEdited = false;
|
this.isEventEdited = false;
|
||||||
/* this.postEvent.EventRecurrence = { Type:'-1', LastOccurrence:''}; */
|
/* this.postEvent.EventRecurrence = { Type:'-1', LastOccurrence:''}; */
|
||||||
this.postEvent = this.navParams.get('event');
|
this.postEvent = this.navParams.get('event');
|
||||||
this.postEvent.StartDate = new Date(this.ajustMinuts(this.postEvent.StartDate))
|
|
||||||
this.postEvent.EndDate = new Date(this.ajustMinuts(this.postEvent.EndDate))
|
|
||||||
|
|
||||||
this.caller = this.navParams.get('caller');
|
this.caller = this.navParams.get('caller');
|
||||||
this.initCalendarName = this.postEvent.CalendarName;
|
this.initCalendarName = this.postEvent.CalendarName;
|
||||||
@@ -405,6 +403,7 @@ export class EditEventPage implements OnInit {
|
|||||||
this.httpErrorHandle.httpStatusHandle(error)
|
this.httpErrorHandle.httpStatusHandle(error)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
console.log('edid calendar id',this.postEvent.CalendarId);
|
||||||
this.eventsService.editEvent(this.postEvent, 2, 3, this.postEvent.CalendarId).subscribe(async () => {
|
this.eventsService.editEvent(this.postEvent, 2, 3, this.postEvent.CalendarId).subscribe(async () => {
|
||||||
|
|
||||||
if (window['reloadCalendar']) {
|
if (window['reloadCalendar']) {
|
||||||
@@ -643,26 +642,17 @@ export class EditEventPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ajustMinuts(string) {
|
|
||||||
var partes = string.split(' ');
|
|
||||||
var horaMinuto = partes[1].split(':');
|
|
||||||
if (horaMinuto[1] === '59') {
|
|
||||||
horaMinuto[1] = '00';
|
|
||||||
var novaString = partes[0] + ' ' + horaMinuto.join(':');
|
|
||||||
|
|
||||||
return novaString;
|
|
||||||
}
|
|
||||||
return string;
|
|
||||||
}
|
|
||||||
|
|
||||||
onCheckboxChange(event: any) {
|
onCheckboxChange(event: any) {
|
||||||
|
console.log(this.postEvent.CalendarId)
|
||||||
if (this.allDayCheck) {
|
if (this.allDayCheck) {
|
||||||
this.postEvent.IsAllDayEvent = this.allDayCheck;
|
this.postEvent.IsAllDayEvent = this.allDayCheck;
|
||||||
this.postEvent.StartDate = this.setAlldayTime(this.postEvent.StartDate)
|
this.postEvent.StartDate = this.setAlldayTime(this.postEvent.StartDate)
|
||||||
|
this.postEvent.EndDate = this.setAlldayTimeEndDate(this.postEvent.EndDate)
|
||||||
|
|
||||||
console.log('Recurso ativado!!');
|
console.log('Recurso ativado!!');
|
||||||
} else {
|
} else {
|
||||||
this.postEvent.IsAllDayEvent = this.allDayCheck;
|
this.postEvent.IsAllDayEvent = this.allDayCheck;
|
||||||
|
this.postEvent.EndDate = this.setAlldayTimeEndDateNotAlday(this.postEvent.EndDate)
|
||||||
console.log('Recurso desativado');
|
console.log('Recurso desativado');
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -676,6 +666,28 @@ export class EditEventPage implements OnInit {
|
|||||||
date.setSeconds(0);
|
date.setSeconds(0);
|
||||||
|
|
||||||
|
|
||||||
|
return date
|
||||||
|
}
|
||||||
|
|
||||||
|
setAlldayTimeEndDate(timeToReturn) {
|
||||||
|
let date: any = new Date(timeToReturn) || new Date();
|
||||||
|
let newdate = new Date();
|
||||||
|
date.setHours(23)
|
||||||
|
date.setMinutes(59)
|
||||||
|
date.setSeconds(0);
|
||||||
|
|
||||||
|
|
||||||
|
return date
|
||||||
|
}
|
||||||
|
|
||||||
|
setAlldayTimeEndDateNotAlday(timeToReturn) {
|
||||||
|
let date: any = new Date(timeToReturn) || new Date();
|
||||||
|
let newdate = new Date();
|
||||||
|
date.setHours(23)
|
||||||
|
date.setMinutes(0)
|
||||||
|
date.setSeconds(0);
|
||||||
|
|
||||||
|
|
||||||
return date
|
return date
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,7 +129,7 @@
|
|||||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs materia-top" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
<div *ngIf="allDayCheck" 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 appearance="none" class="date-hour-picker">
|
<mat-form-field appearance="none" class="date-hour-picker">
|
||||||
|
|
||||||
@@ -154,7 +154,42 @@
|
|||||||
|
|
||||||
[stepHour]="1"
|
[stepHour]="1"
|
||||||
[stepMinute]="15"
|
[stepMinute]="15"
|
||||||
[hideTime]="!allDayCheck"
|
[hideTime]="true"
|
||||||
|
|
||||||
|
|
||||||
|
>
|
||||||
|
</ngx-mat-datetime-picker>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="!allDayCheck" 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 appearance="none" class="date-hour-picker">
|
||||||
|
|
||||||
|
<!-- <input matInput [matDatepicker]="picker1"
|
||||||
|
placeholder="Data Inicio*"
|
||||||
|
[(ngModel)]="postEvent.StartDate"
|
||||||
|
[disabled]="disabled"
|
||||||
|
>
|
||||||
|
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||||
|
<mat-datepicker #picker1></mat-datepicker> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||||
|
placeholder="Data Inicio*"
|
||||||
|
[(ngModel)]="postEvent.StartDate"
|
||||||
|
[disabled]="disabled"
|
||||||
|
>
|
||||||
|
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1" ></mat-datepicker-toggle>
|
||||||
|
<ngx-mat-datetime-picker #picker1
|
||||||
|
|
||||||
|
[stepHour]="1"
|
||||||
|
[stepMinute]="15"
|
||||||
|
[hideTime]="false"
|
||||||
|
|
||||||
|
|
||||||
>
|
>
|
||||||
</ngx-mat-datetime-picker>
|
</ngx-mat-datetime-picker>
|
||||||
@@ -163,7 +198,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="!allDayCheck" class="container-div">
|
<div *ngIf="!allDayCheck" class="container-div">
|
||||||
<div class="ion-item-class-2 d-flex">
|
<div class="ion-item-class-2 d-flex">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
@@ -193,6 +227,36 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div *ngIf="allDayCheck" class="container-div">
|
||||||
|
<div class="ion-item-class-2 d-flex">
|
||||||
|
<div class="ion-icon-class">
|
||||||
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
|
</div>
|
||||||
|
<!--
|
||||||
|
[className]="Form?.get('Subject')?.invalid ? 'input-error ion-input-class flex-grow-1' : 'ion-input-class ion-input-class flex-grow-1' "
|
||||||
|
-->
|
||||||
|
<div class="ion-input-class flex-grow-1 justify-center align-center materia-top" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||||
|
|
||||||
|
<mat-form-field appearance="none" class="date-hour-picker" >
|
||||||
|
<input matInput [ngxMatDatetimePicker]="fim"
|
||||||
|
placeholder="Data de fim*"
|
||||||
|
[(ngModel)]="postEvent.EndDate"
|
||||||
|
[disabled]="disabled"
|
||||||
|
[min]="postEvent.StartDate"
|
||||||
|
|
||||||
|
>
|
||||||
|
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim" ></mat-datepicker-toggle>
|
||||||
|
<ngx-mat-datetime-picker #fim
|
||||||
|
|
||||||
|
[stepHour]="1" [stepMinute]="15"
|
||||||
|
[hideTime]="true"
|
||||||
|
>
|
||||||
|
</ngx-mat-datetime-picker>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div *ngIf="postEvent.EventRecurrence.Type != '-1'" class="container-div width-100">
|
<div *ngIf="postEvent.EventRecurrence.Type != '-1'" class="container-div width-100">
|
||||||
|
|||||||
@@ -899,10 +899,12 @@ export class NewEventPage implements OnInit {
|
|||||||
if (this.allDayCheck) {
|
if (this.allDayCheck) {
|
||||||
this.postEvent.IsAllDayEvent = this.allDayCheck;
|
this.postEvent.IsAllDayEvent = this.allDayCheck;
|
||||||
this.postEvent.StartDate = this.setAlldayTime(this.postEvent.StartDate)
|
this.postEvent.StartDate = this.setAlldayTime(this.postEvent.StartDate)
|
||||||
|
this.postEvent.EndDate = this.setAlldayTimeEndDate(this.postEvent.EndDate)
|
||||||
|
|
||||||
console.log('Recurso ativado!!');
|
console.log('Recurso ativado!!');
|
||||||
} else {
|
} else {
|
||||||
this.postEvent.IsAllDayEvent = this.allDayCheck;
|
this.postEvent.IsAllDayEvent = this.allDayCheck;
|
||||||
|
this.postEvent.EndDate = this.setAlldayTimeEndDateNotAlday(this.postEvent.EndDate)
|
||||||
console.log('Recurso desativado');
|
console.log('Recurso desativado');
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -916,6 +918,28 @@ export class NewEventPage implements OnInit {
|
|||||||
date.setSeconds(0);
|
date.setSeconds(0);
|
||||||
|
|
||||||
|
|
||||||
|
return date
|
||||||
|
}
|
||||||
|
|
||||||
|
setAlldayTimeEndDate(timeToReturn) {
|
||||||
|
let date: any = new Date(timeToReturn) || new Date();
|
||||||
|
let newdate = new Date();
|
||||||
|
date.setHours(23)
|
||||||
|
date.setMinutes(59)
|
||||||
|
date.setSeconds(0);
|
||||||
|
|
||||||
|
|
||||||
|
return date
|
||||||
|
}
|
||||||
|
|
||||||
|
setAlldayTimeEndDateNotAlday(timeToReturn) {
|
||||||
|
let date: any = new Date(timeToReturn) || new Date();
|
||||||
|
let newdate = new Date();
|
||||||
|
date.setHours(23)
|
||||||
|
date.setMinutes(0)
|
||||||
|
date.setSeconds(0);
|
||||||
|
|
||||||
|
|
||||||
return date
|
return date
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,6 +124,15 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container-div">
|
<div class="container-div">
|
||||||
|
<div>
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Todo dia</ion-label>
|
||||||
|
<ion-checkbox [(ngModel)]="allDayCheck" (ionChange)="onCheckboxChange($event)"></ion-checkbox>
|
||||||
|
</ion-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="allDayCheck" class="container-div">
|
||||||
<div class="ion-item-class-2 width-100 d-flex">
|
<div class="ion-item-class-2 width-100 d-flex">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
@@ -135,7 +144,7 @@
|
|||||||
[(ngModel)]="_postEvent.StartDate" [max]="maxDate" [disabled]="disabled">
|
[(ngModel)]="_postEvent.StartDate" [max]="maxDate" [disabled]="disabled">
|
||||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||||
<ngx-mat-datetime-picker #picker1 [showSpinners]="showSpinners" [showSeconds]="showSeconds"
|
<ngx-mat-datetime-picker #picker1 [showSpinners]="showSpinners" [showSeconds]="showSeconds"
|
||||||
[stepHour]="stepHour" [stepMinute]="stepMinute" [stepSecond]="stepSecond" [touchUi]="touchUi">
|
[stepHour]="stepHour" [stepMinute]="stepMinute" [stepSecond]="stepSecond" [touchUi]="touchUi" [hideTime]="true">
|
||||||
</ngx-mat-datetime-picker>
|
</ngx-mat-datetime-picker>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@@ -143,7 +152,27 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container-div">
|
<div *ngIf="!allDayCheck" class="container-div">
|
||||||
|
<div class="ion-item-class-2 width-100 d-flex">
|
||||||
|
<div class="ion-icon-class">
|
||||||
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
|
</div>
|
||||||
|
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||||
|
|
||||||
|
<mat-form-field appearance="none" floatLabel="never" class="date-hour-picker">
|
||||||
|
<input matInput [ngxMatDatetimePicker]="picker1" placeholder="Choose a date"
|
||||||
|
[(ngModel)]="_postEvent.StartDate" [max]="maxDate" [disabled]="disabled">
|
||||||
|
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||||
|
<ngx-mat-datetime-picker #picker1 [showSpinners]="showSpinners" [showSeconds]="showSeconds"
|
||||||
|
[stepHour]="stepHour" [stepMinute]="stepMinute" [stepSecond]="stepSecond" [touchUi]="touchUi" [hideTime]="false">
|
||||||
|
</ngx-mat-datetime-picker>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="allDayCheck" class="container-div">
|
||||||
<div class="ion-item-class-2 width-100 d-flex">
|
<div class="ion-item-class-2 width-100 d-flex">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
@@ -155,7 +184,27 @@
|
|||||||
[max]="maxDate" [disabled]="disabled" [min]="_postEvent.StartDate">
|
[max]="maxDate" [disabled]="disabled" [min]="_postEvent.StartDate">
|
||||||
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
||||||
<ngx-mat-datetime-picker #fim [showSpinners]="showSpinners" [showSeconds]="showSeconds"
|
<ngx-mat-datetime-picker #fim [showSpinners]="showSpinners" [showSeconds]="showSeconds"
|
||||||
[stepHour]="stepHour" [stepMinute]="stepMinute" [stepSecond]="stepSecond">
|
[stepHour]="stepHour" [stepMinute]="stepMinute" [stepSecond]="stepSecond" [hideTime]="true">
|
||||||
|
</ngx-mat-datetime-picker>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="!allDayCheck" class="container-div">
|
||||||
|
<div class="ion-item-class-2 width-100 d-flex">
|
||||||
|
<div class="ion-icon-class">
|
||||||
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
|
</div>
|
||||||
|
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||||
|
|
||||||
|
<mat-form-field appearance="none" floatLabel="never" floatLabel="never" class="date-hour-picker">
|
||||||
|
<input matInput [ngxMatDatetimePicker]="fim" placeholder="Choose a date" [(ngModel)]="_postEvent.EndDate"
|
||||||
|
[max]="maxDate" [disabled]="disabled" [min]="_postEvent.StartDate">
|
||||||
|
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
||||||
|
<ngx-mat-datetime-picker #fim [showSpinners]="showSpinners" [showSeconds]="showSeconds"
|
||||||
|
[stepHour]="stepHour" [stepMinute]="stepMinute" [stepSecond]="stepSecond" [hideTime]="false">
|
||||||
</ngx-mat-datetime-picker>
|
</ngx-mat-datetime-picker>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ export class EditEventPage implements OnInit {
|
|||||||
|
|
||||||
CalendarNameOwnerName = ''
|
CalendarNameOwnerName = ''
|
||||||
CalendarNamesOptions = []
|
CalendarNamesOptions = []
|
||||||
|
allDayCheck: boolean = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
@@ -107,8 +108,7 @@ export class EditEventPage implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this._postEvent = this.postEvent
|
this._postEvent = this.postEvent
|
||||||
this.postEvent.StartDate = new Date(this.ajustMinuts(this.postEvent.StartDate))
|
this.allDayCheck = this.postEvent.IsAllDayEvent;
|
||||||
this.postEvent.EndDate = new Date(this.ajustMinuts(this.postEvent.EndDate))
|
|
||||||
if(!this.restoreTemporaryData()) {
|
if(!this.restoreTemporaryData()) {
|
||||||
// clear
|
// clear
|
||||||
|
|
||||||
@@ -584,16 +584,53 @@ export class EditEventPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ajustMinuts(string) {
|
onCheckboxChange(event: any) {
|
||||||
var partes = string.split(' ');
|
console.log(this.postEvent.CalendarId)
|
||||||
var horaMinuto = partes[1].split(':');
|
if (this.allDayCheck) {
|
||||||
if (horaMinuto[1] === '59') {
|
this.postEvent.IsAllDayEvent = this.allDayCheck;
|
||||||
horaMinuto[1] = '00';
|
this.postEvent.StartDate = this.setAlldayTime(this.postEvent.StartDate)
|
||||||
var novaString = partes[0] + ' ' + horaMinuto.join(':');
|
this.postEvent.EndDate = this.setAlldayTimeEndDate(this.postEvent.EndDate)
|
||||||
|
|
||||||
|
console.log('Recurso ativado!!');
|
||||||
|
} else {
|
||||||
|
this.postEvent.IsAllDayEvent = this.allDayCheck;
|
||||||
|
this.postEvent.EndDate = this.setAlldayTimeEndDateNotAlday(this.postEvent.EndDate)
|
||||||
|
console.log('Recurso desativado');
|
||||||
|
|
||||||
return novaString;
|
|
||||||
}
|
}
|
||||||
return string;
|
}
|
||||||
|
|
||||||
|
setAlldayTime(timeToReturn) {
|
||||||
|
let date: any = new Date(timeToReturn) || new Date();
|
||||||
|
let newdate = new Date();
|
||||||
|
date.setHours(0)
|
||||||
|
date.setMinutes(0)
|
||||||
|
date.setSeconds(0);
|
||||||
|
|
||||||
|
|
||||||
|
return date
|
||||||
|
}
|
||||||
|
|
||||||
|
setAlldayTimeEndDate(timeToReturn) {
|
||||||
|
let date: any = new Date(timeToReturn) || new Date();
|
||||||
|
let newdate = new Date();
|
||||||
|
date.setHours(23)
|
||||||
|
date.setMinutes(59)
|
||||||
|
date.setSeconds(0);
|
||||||
|
|
||||||
|
|
||||||
|
return date
|
||||||
|
}
|
||||||
|
|
||||||
|
setAlldayTimeEndDateNotAlday(timeToReturn) {
|
||||||
|
let date: any = new Date(timeToReturn) || new Date();
|
||||||
|
let newdate = new Date();
|
||||||
|
date.setHours(23)
|
||||||
|
date.setMinutes(0)
|
||||||
|
date.setSeconds(0);
|
||||||
|
|
||||||
|
|
||||||
|
return date
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,6 +124,15 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container-div">
|
<div class="container-div">
|
||||||
|
<div>
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Todo dia</ion-label>
|
||||||
|
<ion-checkbox [(ngModel)]="allDayCheck" (ionChange)="onCheckboxChange($event)"></ion-checkbox>
|
||||||
|
</ion-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="allDayCheck" class="container-div">
|
||||||
<div class="ion-item-class-2 d-flex" >
|
<div class="ion-item-class-2 d-flex" >
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
@@ -144,6 +153,7 @@
|
|||||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||||
[stepSecond]="stepSecond"
|
[stepSecond]="stepSecond"
|
||||||
[touchUi]="touchUi"
|
[touchUi]="touchUi"
|
||||||
|
[hideTime]="true"
|
||||||
>
|
>
|
||||||
</ngx-mat-datetime-picker>
|
</ngx-mat-datetime-picker>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
@@ -152,7 +162,37 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container-div">
|
<div *ngIf="!allDayCheck" class="container-div">
|
||||||
|
<div class="ion-item-class-2 d-flex" >
|
||||||
|
<div class="ion-icon-class">
|
||||||
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs materia-top" >
|
||||||
|
|
||||||
|
<mat-form-field appearance="none" class="date-hour-picker">
|
||||||
|
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||||
|
placeholder="Data Inicio*"
|
||||||
|
[(ngModel)]="postEvent.StartDate"
|
||||||
|
[disabled]="disabled"
|
||||||
|
>
|
||||||
|
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1" ></mat-datepicker-toggle>
|
||||||
|
<ngx-mat-datetime-picker #picker1
|
||||||
|
[showSpinners]="showSpinners"
|
||||||
|
[showSeconds]="showSeconds"
|
||||||
|
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||||
|
[stepSecond]="stepSecond"
|
||||||
|
[touchUi]="touchUi"
|
||||||
|
[hideTime]="false"
|
||||||
|
>
|
||||||
|
</ngx-mat-datetime-picker>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="allDayCheck" class="container-div">
|
||||||
<div class="ion-item-class-2 d-flex">
|
<div class="ion-item-class-2 d-flex">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
@@ -175,6 +215,39 @@
|
|||||||
[showSeconds]="showSeconds"
|
[showSeconds]="showSeconds"
|
||||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||||
[stepSecond]="stepSecond"
|
[stepSecond]="stepSecond"
|
||||||
|
[hideTime]="true"
|
||||||
|
>
|
||||||
|
</ngx-mat-datetime-picker>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="!allDayCheck" class="container-div">
|
||||||
|
<div class="ion-item-class-2 d-flex">
|
||||||
|
<div class="ion-icon-class">
|
||||||
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
|
</div>
|
||||||
|
<!--
|
||||||
|
[className]="Form?.get('Subject')?.invalid ? 'input-error ion-input-class flex-grow-1' : 'ion-input-class ion-input-class flex-grow-1' "
|
||||||
|
-->
|
||||||
|
<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 appearance="none" class="date-hour-picker">
|
||||||
|
<input matInput [ngxMatDatetimePicker]="fim"
|
||||||
|
placeholder="Data de fim*"
|
||||||
|
[(ngModel)]="postEvent.EndDate"
|
||||||
|
[disabled]="disabled"
|
||||||
|
[min]="postEvent.StartDate"
|
||||||
|
>
|
||||||
|
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim" ></mat-datepicker-toggle>
|
||||||
|
<ngx-mat-datetime-picker #fim
|
||||||
|
[showSpinners]="showSpinners"
|
||||||
|
[showSeconds]="showSeconds"
|
||||||
|
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||||
|
[stepSecond]="stepSecond"
|
||||||
|
[hideTime]="false"
|
||||||
>
|
>
|
||||||
</ngx-mat-datetime-picker>
|
</ngx-mat-datetime-picker>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ export class NewEventPage implements OnInit {
|
|||||||
environment = environment
|
environment = environment
|
||||||
eventPersons: EventPerson[];
|
eventPersons: EventPerson[];
|
||||||
contacts: EventPerson[] = [];
|
contacts: EventPerson[] = [];
|
||||||
|
allDayCheck: boolean = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
@@ -1044,5 +1045,53 @@ console.log(this.loggeduser.Profile)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onCheckboxChange(event: any) {
|
||||||
|
if (this.allDayCheck) {
|
||||||
|
this.postEvent.IsAllDayEvent = this.allDayCheck;
|
||||||
|
this.postEvent.StartDate = this.setAlldayTime(this.postEvent.StartDate)
|
||||||
|
this.postEvent.EndDate = this.setAlldayTimeEndDate(this.postEvent.EndDate)
|
||||||
|
|
||||||
|
console.log('Recurso ativado!!');
|
||||||
|
} else {
|
||||||
|
this.postEvent.IsAllDayEvent = this.allDayCheck;
|
||||||
|
this.postEvent.EndDate = this.setAlldayTimeEndDateNotAlday(this.postEvent.EndDate)
|
||||||
|
console.log('Recurso desativado');
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setAlldayTime(timeToReturn) {
|
||||||
|
let date: any = new Date(timeToReturn) || new Date();
|
||||||
|
let newdate = new Date();
|
||||||
|
date.setHours(0)
|
||||||
|
date.setMinutes(0)
|
||||||
|
date.setSeconds(0);
|
||||||
|
|
||||||
|
|
||||||
|
return date
|
||||||
|
}
|
||||||
|
|
||||||
|
setAlldayTimeEndDate(timeToReturn) {
|
||||||
|
let date: any = new Date(timeToReturn) || new Date();
|
||||||
|
let newdate = new Date();
|
||||||
|
date.setHours(23)
|
||||||
|
date.setMinutes(59)
|
||||||
|
date.setSeconds(0);
|
||||||
|
|
||||||
|
|
||||||
|
return date
|
||||||
|
}
|
||||||
|
|
||||||
|
setAlldayTimeEndDateNotAlday(timeToReturn) {
|
||||||
|
let date: any = new Date(timeToReturn) || new Date();
|
||||||
|
let newdate = new Date();
|
||||||
|
date.setHours(23)
|
||||||
|
date.setMinutes(0)
|
||||||
|
date.setSeconds(0);
|
||||||
|
|
||||||
|
|
||||||
|
return date
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user