fix: fix date input issue with initializer

This commit is contained in:
Ruben Fiszel
2025-05-08 16:30:27 +02:00
parent 233bc1bfc5
commit 0cd92932f0
+3 -2
View File
@@ -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