set default time

This commit is contained in:
Peter Maquiran
2023-02-13 18:50:31 +01:00
parent 1f5abcaa7a
commit b84161765e
9 changed files with 72 additions and 18 deletions
@@ -62,13 +62,11 @@ export class EditEventPage implements OnInit {
public showSeconds = false;
public touchUi = false;
public enableMeridian = false;
public minDate = new Date().toISOString().slice(0,10)
public endMinDate = new Date(new Date().getTime() + 15 * 60000).toISOString().slice(0,10)
public maxDate: any;
public stepHour = 1;
public stepMinute = 15;
public stepSecond = 15;
currentDate = this.roundTimeQuarterHour();
loadedEventAttachments: Attachment[] = [];
taskParticipants: any = [];
@@ -193,6 +191,13 @@ export class EditEventPage implements OnInit {
return date
}
roundTimeQuarterHourPlus15(date:Date) {
const _date = new Date(date);
const minutes = _date .getMinutes();
_date .setMinutes(minutes + 15)
return _date
}
onSelectedRecurringChanged(ev?:any) {
this.calculetedLastOccurrence(ev);
@@ -51,7 +51,6 @@ export class NewEventPage implements OnInit {
public stepMinute = 15;
public stepSecond = 15;
public color: ThemePalette = 'primary';
currentDate = this.roundTimeQuarterHour();
Form: FormGroup;
validateFrom = false
@@ -190,7 +189,7 @@ export class NewEventPage implements OnInit {
setDefaultTime() {
this.postEvent.StartDate = this.roundTimeQuarterHour(this.CalendarDate);
this.postEvent.EndDate = this.postEvent.StartDate;
this.postEvent.EndDate = this.roundTimeQuarterHourPlus15(this.postEvent.StartDate);
}
close() {
@@ -219,6 +218,12 @@ export class NewEventPage implements OnInit {
return date
}
roundTimeQuarterHourPlus15(date:Date) {
const _date = new Date(date);
const minutes = _date .getMinutes();
_date .setMinutes(minutes + 15)
return _date
}
setStartDate() {
if(!this.postEvent.StartDate) {
this.postEvent.StartDate = this.roundTimeQuarterHour();
@@ -135,8 +135,9 @@ export class BookMeetingModalPage implements OnInit {
this.postData.Subject = this.task.Folio;
this.postData.CalendarName = "Oficial";
this.dateControlStart = new FormControl(moment(this.roundTimeQuarterHour()));
this.dateControlEnd = new FormControl(moment(new Date(this.roundTimeQuarterHour())));
let startDate = this.roundTimeQuarterHour()
this.dateControlStart = new FormControl(moment(startDate));
this.dateControlEnd = new FormControl(moment(this.roundTimeQuarterHourPlus15(startDate)));
this.postData.Category = 'Reunião'
@@ -200,7 +201,7 @@ export class BookMeetingModalPage implements OnInit {
setDefaultTime() {
this.postData.StartDate = this.roundTimeQuarterHour();
this.postData.EndDate = (new Date(this.postData.StartDate.getTime() + 15 * 60000))
this.postData.EndDate = this.roundTimeQuarterHourPlus15(this.postData.StartDate);
}
getAttachments() {
@@ -520,6 +521,15 @@ export class BookMeetingModalPage implements OnInit {
return date
}
roundTimeQuarterHourPlus15(date:Date) {
const _date = new Date(date);
const minutes = _date .getMinutes();
_date .setMinutes(minutes + 15)
return _date
}
setStartDate() {
this.postData.StartDate = this.roundTimeQuarterHour();
}
@@ -73,7 +73,7 @@ export class NewActionPage implements OnInit {
this.folder = new PublicationFolder();
this.dateControlStart = new FormControl(this.roundTimeQuarterHour());
this.dateControlEnd = new FormControl(this.dateControlStart.value);
this.dateControlEnd = new FormControl(this.roundTimeQuarterHourPlus15(this.dateControlStart.value));
}
@@ -177,4 +177,11 @@ export class NewActionPage implements OnInit {
return date
}
roundTimeQuarterHourPlus15(date:Date) {
const _date = new Date(date);
const minutes = _date .getMinutes();
_date .setMinutes(minutes + 15)
return _date
}
}