From 0cd92932f0e0998fc30ac02065d292ec35db5cae Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 8 May 2025 16:30:27 +0200 Subject: [PATCH] fix: fix date input issue with initializer --- frontend/src/lib/components/DateInput.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/DateInput.svelte b/frontend/src/lib/components/DateInput.svelte index dec411f6cc..c39e6149e3 100644 --- a/frontend/src/lib/components/DateInput.svelte +++ b/frontend/src/lib/components/DateInput.svelte @@ -10,12 +10,13 @@ export let dateFormat: string | undefined = 'dd-MM-yyyy' export let disabled: boolean = false + const defaultDateFormat = 'dd-MM-yyyy' + const defaultHtmlDateFormat = 'yyyy-MM-dd' + let date: string | undefined = computeDate(value) const dispatch = createEventDispatcher() - const defaultDateFormat = 'dd-MM-yyyy' - const defaultHtmlDateFormat = 'yyyy-MM-dd' function computeDate(value: string | undefined) { if (dateFormat === undefined) { dateFormat = defaultDateFormat