-een gebruiker kan meerdere bedrijven hebben
-manier van afspraken maken veranderd in de backend ivm meerdere bedrijven gebruiker -email is aangepast op bedrijf en gebruiker -dropdown voor instellingen toegevoegd
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
TuiTextfieldControllerModule
|
||||
} from "@taiga-ui/legacy";
|
||||
import {Appointment} from '../../models/appointment';
|
||||
import {TuiDay, TuiTime, TuiValidationError} from '@taiga-ui/cdk';
|
||||
import {TuiDay, TuiValidationError} from '@taiga-ui/cdk';
|
||||
import {AppointmentService} from '../../services/appointment.service';
|
||||
import {TuiDataListWrapperComponent, TuiFilterByInputPipe, TuiStringifyContentPipe} from '@taiga-ui/kit';
|
||||
import {Customer} from '../../models/customer';
|
||||
@@ -70,25 +70,13 @@ export class NewItemComponent implements OnInit {
|
||||
lastName: new FormControl('', Validators.required),
|
||||
email: new FormControl('', [Validators.required, Validators.email]),
|
||||
})
|
||||
this.appointmentForm.get('startTime').setValue(new TuiTime(this.today.getHours(), this.today.getMinutes()), Validators.required)
|
||||
this.appointmentForm.get('endTime').setValue(new TuiTime(this.getEndTime().getHours(), this.getEndTime().getMinutes()), [Validators.required, timeAfterStartValidator('startTime')])
|
||||
this.appointmentForm.get('startTime').setValue('', Validators.required)
|
||||
this.appointmentForm.get('endTime').setValue('', [Validators.required, timeAfterStartValidator('startTime')])
|
||||
this.appointments.sort((a, b) => {
|
||||
return a.startHour - b.startHour || a.startMinute - b.startMinute;
|
||||
});
|
||||
}
|
||||
|
||||
getEndTime(): Date {
|
||||
const endTime = new Date(this.today); // Kopieer startTime
|
||||
endTime.setMinutes(endTime.getMinutes() + 30); // 30 minuten toevoegen
|
||||
|
||||
// Controleer of de dag nog steeds hetzelfde is
|
||||
if (endTime.getDate() !== this.today.getDate()) {
|
||||
endTime.setHours(23, 59, 59, 999); // Zet naar 23:59:59 als het overloopt
|
||||
}
|
||||
|
||||
return endTime;
|
||||
}
|
||||
|
||||
registerAppointment() {
|
||||
const title = this.appointmentForm.get('title').value
|
||||
const description = this.appointmentForm.get('notes').value
|
||||
|
||||
Reference in New Issue
Block a user