auto select owner as rower of private boat, Fixes #46

This commit is contained in:
2023-11-02 19:50:19 +01:00
parent d9322c9702
commit f5ad37a0bb
2 changed files with 6 additions and 2 deletions

View File

@ -35,6 +35,7 @@ interface ChoiceBoatEvent extends Event{
label: string,
customProperties: {
amount_seats: number,
owner: number,
}
};
}
@ -55,6 +56,10 @@ function selectBoatChange() {
const amount_seats = event.detail.customProperties.amount_seats;
setMaxAmountRowers("newrower", amount_seats);
if (event.detail.customProperties.owner){
choiceObjects["newrower"].setChoiceByValue(event.detail.customProperties.owner+"");
}
const inputElement = document.getElementById("departure") as HTMLInputElement;
const now = new Date();
const formattedDateTime = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}T${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`;
@ -201,7 +206,6 @@ function initNewChoice(select: HTMLInputElement) {
if (select.dataset && select.dataset.seats) {
seats = +select.dataset.seats;
}
console.log(seats);
let shipmaster = <HTMLElement>document.querySelector('#shipmaster-'+select.id+'js');
let steering_person = <HTMLElement>document.querySelector('#steering_person-'+select.id+'js');