mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
changed agenda edit event timepicker interval by 15 minutes
This commit is contained in:
@@ -163,7 +163,7 @@
|
|||||||
<input matInput [ngxMatDatetimePicker]="fim"
|
<input matInput [ngxMatDatetimePicker]="fim"
|
||||||
placeholder="Choose a date"
|
placeholder="Choose a date"
|
||||||
[(ngModel)]="postEvent.EndDate"
|
[(ngModel)]="postEvent.EndDate"
|
||||||
[min]="currentDate"
|
[min]="postEvent.StartDate"
|
||||||
[max]="maxDate"
|
[max]="maxDate"
|
||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -66,9 +66,9 @@ export class EditEventPage implements OnInit {
|
|||||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000).toISOString().slice(0,10)
|
public endMinDate = new Date(new Date().getTime() + 15 * 60000).toISOString().slice(0,10)
|
||||||
public maxDate: any;
|
public maxDate: any;
|
||||||
public stepHour = 1;
|
public stepHour = 1;
|
||||||
public stepMinute = 5;
|
public stepMinute = 15;
|
||||||
public stepSecond = 5;
|
public stepSecond = 15;
|
||||||
currentDate = new Date();
|
currentDate = this.roundTimeQuarterHour();
|
||||||
|
|
||||||
loadedEventAttachments: Attachment[] = [];
|
loadedEventAttachments: Attachment[] = [];
|
||||||
taskParticipants: any = [];
|
taskParticipants: any = [];
|
||||||
@@ -171,6 +171,39 @@ export class EditEventPage implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
roundTimeQuarterHour() {
|
||||||
|
var timeToReturn = new Date();
|
||||||
|
// var minutes = timeToReturn.getMinutes();
|
||||||
|
var minutes = timeToReturn.getMinutes();
|
||||||
|
var hours = timeToReturn.getHours();
|
||||||
|
|
||||||
|
// console.log("MINUTOS: " +minutes);
|
||||||
|
// console.log("BEFORE MINUTES: " +(Math.round(minutes/15) * 15));
|
||||||
|
|
||||||
|
var m = (Math.round(minutes/15) * 15) % 60;
|
||||||
|
// console.log("AFTER MINUTES: " +m);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onSelectedRecurringChanged(ev?:any) {
|
onSelectedRecurringChanged(ev?:any) {
|
||||||
|
|
||||||
this.calculetedLastOccurrence(ev);
|
this.calculetedLastOccurrence(ev);
|
||||||
|
|||||||
@@ -147,7 +147,7 @@
|
|||||||
[(ngModel)]="postEvent.EndDate"
|
[(ngModel)]="postEvent.EndDate"
|
||||||
[max]="maxDate"
|
[max]="maxDate"
|
||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
[min]="currentDate"
|
[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
|
<ngx-mat-datetime-picker #fim
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ export class EditEventPage implements OnInit {
|
|||||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000).toISOString().slice(0,10)
|
public endMinDate = new Date(new Date().getTime() + 15 * 60000).toISOString().slice(0,10)
|
||||||
public maxDate: any;
|
public maxDate: any;
|
||||||
public stepHour = 1;
|
public stepHour = 1;
|
||||||
public stepMinute = 5;
|
public stepMinute = 15;
|
||||||
public stepSecond = 5;
|
public stepSecond = 15;
|
||||||
currentDate = new Date();
|
currentDate = this.roundTimeQuarterHour();
|
||||||
|
|
||||||
Form: FormGroup;
|
Form: FormGroup;
|
||||||
validateFrom = false
|
validateFrom = false
|
||||||
@@ -216,6 +216,39 @@ export class EditEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
roundTimeQuarterHour() {
|
||||||
|
var timeToReturn = new Date();
|
||||||
|
// var minutes = timeToReturn.getMinutes();
|
||||||
|
var minutes = timeToReturn.getMinutes();
|
||||||
|
var hours = timeToReturn.getHours();
|
||||||
|
|
||||||
|
// console.log("MINUTOS: " +minutes);
|
||||||
|
// console.log("BEFORE MINUTES: " +(Math.round(minutes/15) * 15));
|
||||||
|
|
||||||
|
var m = (Math.round(minutes/15) * 15) % 60;
|
||||||
|
// console.log("AFTER MINUTES: " +m);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onSelectedRecurringChanged(ev:any){
|
onSelectedRecurringChanged(ev:any){
|
||||||
|
|
||||||
this.calculetedLastOccurrence(ev);
|
this.calculetedLastOccurrence(ev);
|
||||||
|
|||||||
Reference in New Issue
Block a user