refactor(main.ts): refactor selectBoatChange and initNewChoice functions

This commit is contained in:
philipp 2023-11-12 13:27:27 +01:00
parent 9983d0f14a
commit 34775ace90

View File

@ -138,6 +138,9 @@ function selectBoatChange() {
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')}`;
inputElement.value = formattedDateTime;
document.getElementById("distance_in_km").value = "";
document.getElementById("destination").dispatchEvent(new Event('input'));
},false);
choiceObjects[boatSelect.id] = boatChoice;
@ -376,6 +379,7 @@ function initNewChoice(select: HTMLInputElement) {
},false);
choiceObjects[select.id] = choice;
document.getElementById("distance_in_km").value = "";
}