issue-20 #46

Merged
sebastian merged 15 commits from issue-20 into master 2023-11-12 13:18:53 +01:00
2 changed files with 14 additions and 3 deletions
Showing only changes of commit 58969351cb - Show all commits

View File

@ -14,10 +14,10 @@
<label class="example-value-label">{{task!.eta}}</label> <label class="example-value-label">{{task!.eta}}</label>
</div> </div>
<mat-slider min="0" [max]="task!.eta" step="15" style="width: 100%;" [discrete]="true" [showTickMarks]="true" #slider > <mat-slider min="0" [max]="task!.eta" step="15" style="width: 100%;" [discrete]="true" [showTickMarks]="true" #slider >
<input matSliderThumb> <input matSliderThumb [(ngModel)]="slideMinutes">
</mat-slider> </mat-slider>
</div> </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>
<div class="progress-stacked" > <div class="progress-stacked" >

View File

@ -32,6 +32,7 @@ export class AdvancedSchedulerComponent implements OnInit, OnChanges{
@ViewChild('startTimePicker') startTimePicker?: DateTimePickerComponent; @ViewChild('startTimePicker') startTimePicker?: DateTimePickerComponent;
@ViewChild('stopTimePicker') stopTimePicker?: DateTimePickerComponent; @ViewChild('stopTimePicker') stopTimePicker?: DateTimePickerComponent;
slideMinutes: number = 0;
@Output('onStartTimeSet') startTimeEmitter : EventEmitter<Date> = new EventEmitter<Date>(); @Output('onStartTimeSet') startTimeEmitter : EventEmitter<Date> = new EventEmitter<Date>();
@Output('onEndTimeSet') endTimeEmitter : 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());
}
}
}
} }