Add Slider Minutes to EndTime
All checks were successful
Java CI with Maven / build (push) Successful in 46s

This commit is contained in:
Sebastian Böckelmann 2023-11-12 12:05:14 +01:00
parent 753227afec
commit 58969351cb
2 changed files with 14 additions and 3 deletions

View File

@ -13,11 +13,11 @@
<label id="example-name-label" class="example-name-label">0</label>
<label class="example-value-label">{{task!.eta}}</label>
</div>
<mat-slider min="0" [max]="task!.eta" step="15" style="width: 100%;" [discrete]="true" [showTickMarks]="true" #slider>
<input matSliderThumb>
<mat-slider min="0" [max]="task!.eta" step="15" style="width: 100%;" [discrete]="true" [showTickMarks]="true" #slider >
<input matSliderThumb [(ngModel)]="slideMinutes">
</mat-slider>
</div>
<button style="margin-left: 20px" mat-raised-button color="primary">Add</button>
<button style="margin-left: 20px" mat-raised-button color="primary" (click)="addSlideMinutes()">Add</button>
</div>
<div class="progress-stacked" >

View File

@ -32,6 +32,7 @@ export class AdvancedSchedulerComponent implements OnInit, OnChanges{
@ViewChild('startTimePicker') startTimePicker?: DateTimePickerComponent;
@ViewChild('stopTimePicker') stopTimePicker?: DateTimePickerComponent;
slideMinutes: number = 0;
@Output('onStartTimeSet') startTimeEmitter : EventEmitter<Date> = new EventEmitter<Date>();
@Output('onEndTimeSet') endTimeEmitter : EventEmitter<Date> = new EventEmitter<Date>();
@ -152,4 +153,14 @@ export class AdvancedSchedulerComponent implements OnInit, OnChanges{
}
}
addSlideMinutes() {
if(this.selectedStartTime != undefined) {
const updatedStopTime = moment(this.selectedStartTime);
updatedStopTime.add(this.slideMinutes, 'm');
if(updatedStopTime.isAfter(moment(this.selectedStopTime))) {
this.setStopTime(updatedStopTime.toDate());
}
}
}
}