new shizzle for nizzle

This commit is contained in:
2025-03-12 23:44:29 +01:00
parent 6b72efe9d0
commit c3663e4c6e
19 changed files with 179 additions and 71 deletions

View File

@@ -17,6 +17,7 @@ import {DetailsComponent} from '../../components/details/details.component';
import {DateFormatter} from '../../utils/date-formatter';
import {WeekDay} from '../../models/week-day';
import {NewItemComponent} from '../../components/new-item/new-item.component';
import {timeAfterStartValidator} from '../../models/validators/time-after-start-validator';
@Component({
selector: 'app-agenda',
@@ -52,7 +53,7 @@ export class AgendaComponent implements OnInit {
title: new FormControl('', Validators.required),
notes: new FormControl(''),
startTime: new FormControl(new TuiTime(this.today.getHours(), this.today.getMinutes()), Validators.required),
endTime: new FormControl(new TuiTime(this.getHours(), this.getMinutes()), Validators.required),
endTime: new FormControl(new TuiTime(this.getHours(), this.getMinutes()), [Validators.required, timeAfterStartValidator('startTime')]),
date: new FormControl(new TuiDay(this.selectedDate.getFullYear(), this.selectedDate.getMonth(), this.selectedDate.getDate()), Validators.required),
});
@@ -90,7 +91,7 @@ export class AgendaComponent implements OnInit {
title: new FormControl('', Validators.required),
notes: new FormControl(''),
startTime: new FormControl(new TuiTime(this.today.getHours(), this.today.getMinutes()), Validators.required),
endTime: new FormControl(new TuiTime(this.getEndTime().getHours(), this.getEndTime().getMinutes()), Validators.required),
endTime: new FormControl(new TuiTime(this.getEndTime().getHours(), this.getEndTime().getMinutes()), [Validators.required, timeAfterStartValidator('startTime')]),
date: new FormControl(new TuiDay(this.selectedDate.getFullYear(), this.selectedDate.getMonth(), this.selectedDate.getDate()), Validators.required),
});
}
@@ -109,7 +110,6 @@ export class AgendaComponent implements OnInit {
getHours() {
let hours = this.today.getHours()
console.log(hours)
if (hours > 23) {
return 23
}