diff --git a/frontend/main.ts b/frontend/main.ts index f65bfe0..81a845d 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -22,14 +22,23 @@ document.addEventListener('DOMContentLoaded', function() { function setCurrentdate(input: HTMLInputElement) { if(input) { - 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')}`; - inputElement.value = formattedDateTime; + input.value = formattedDateTime; } } +interface ChoiceBoatEvent extends Event{ + detail: { + value: string; + label: string, + customProperties: { + amount_seats: number, + } + }; +} + function selectBoatChange() { const boatSelect = document.querySelector('#boat_id'); @@ -39,43 +48,22 @@ function selectBoatChange() { noResultsText: 'Keine Ergebnisse gefunden', noChoicesText: 'Keine Ergebnisse gefunden', itemSelectText: 'Zum Auswählen klicken', - callbackOnCreateTemplates: function () { - return { - option: ({ label, value, customProperties, active, disabled, }: any) => { - const opt: HTMLOptionElement = Choices.defaults.templates.option.call( - this, - { label, value, customProperties, active, disabled } - ); - - // We get the original