Ausweis Speichern und Startmonat

This commit is contained in:
Moritz Utcke
2024-12-20 14:44:10 +07:00
parent 06f9b3dc49
commit f89c5e1271
2 changed files with 34 additions and 51 deletions

View File

@@ -65,8 +65,8 @@
fuelMap[fuel[0]].push(fuel[1]);
}
let month = ausweis.startdatum?.getMonth() || null;
let year = ausweis.startdatum?.getFullYear() || null;
let month = ausweis.startdatum?.getMonth();
let year = ausweis.startdatum?.getFullYear();
$: {
if (typeof month === "number" && typeof year === "number") {
@@ -158,11 +158,11 @@ xl:grid-cols-3 xl:gap-x-8 xl:gap-y-8
{#each Array.from(availableDates.reduce((a, c) => {
a.add(c.month);
return a;
}, new Set())) as month}
}, new Set())) as availableMonth}
<option
value={month}
selected={ausweis.startdatum?.getMonth() === month}
>{monthNames[month]}</option
value={availableMonth}
selected={month === availableMonth}
>{monthNames[availableMonth]}</option
>
{/each}
{/if}