Notification Update (Selector)
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
GebaeudeClient,
|
||||
VerbrauchsausweisWohnenClient,
|
||||
} from "./types.js";
|
||||
import { addNotification } from "#components/Notifications/shared.js";
|
||||
|
||||
export let gebaeude: GebaeudeClient;
|
||||
export let gebaeude_aufnahme_allgemein: GebaeudeAufnahmeClient;
|
||||
@@ -81,6 +82,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
$: {
|
||||
console.log(month, year);
|
||||
|
||||
if ((availableDates.filter(date => date.month === month && date.year === year).length === 0) && typeof month === "number" && typeof year === "number") {
|
||||
addNotification({
|
||||
message: "Monat nicht verfügbar.",
|
||||
subtext: "Der ausgewählte Monat ist in diesem Jahr nicht verfügbar, bitte wählen sie einen neuen Start Monat.",
|
||||
dismissable: true,
|
||||
type: "warning",
|
||||
timeout: 0,
|
||||
uid: "monat_nicht_verfuegbar",
|
||||
selector: "select[name='energieverbrauch_zeitraum_monat']"
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
$: abweichung = auditVerbrauchAbweichung(ausweis, gebaeude);
|
||||
</script>
|
||||
|
||||
@@ -147,7 +164,6 @@ xl:grid-cols-3 xl:gap-x-8 xl:gap-y-8
|
||||
bind:value={month}
|
||||
required
|
||||
>
|
||||
<option disabled>Monat</option>
|
||||
{#if year !== null}
|
||||
{#each availableDates.filter((date) => date.year == year) as date}
|
||||
<option value={date.month}
|
||||
@@ -182,7 +198,6 @@ xl:grid-cols-3 xl:gap-x-8 xl:gap-y-8
|
||||
bind:value={year}
|
||||
required
|
||||
>
|
||||
<option disabled>Jahr</option>
|
||||
{#each Array.from(availableDates.reduce((a, c) => {
|
||||
a.add(c.year);
|
||||
return a;
|
||||
|
||||
Reference in New Issue
Block a user