From ada80d093876dceed8464c5d96c1436c70defabb Mon Sep 17 00:00:00 2001 From: Gerd Date: Sun, 30 Aug 2026 15:27:55 +0200 Subject: [PATCH] =?UTF-8?q?Typanpassung=20f=C3=BCr=20toDateInputValue:=20U?= =?UTF-8?q?nterst=C3=BCtzung=20f=C3=BCr=20Datums-=20und=20String-Parameter?= =?UTF-8?q?=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Client/Components/widgets/inputs.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Client/Components/widgets/inputs.ts b/Client/Components/widgets/inputs.ts index 437fd12..6e0d9b6 100644 --- a/Client/Components/widgets/inputs.ts +++ b/Client/Components/widgets/inputs.ts @@ -117,10 +117,12 @@ export const Textarea:m.Component = { } } -export function toDateInputValue(date: Date): string { +export function toDateInputValue(date: Date|string): string { console.log(date, typeof(date), (date instanceof Date)) let result: string = null - if (date instanceof Date && date != null) { + if (typeof date === "string") { + result = date + } else if (date instanceof Date && date != null) { result = [date.getFullYear(), (date.getMonth() + 1).toString().padStart(2, "0"), date.getDate().toString().padStart(2, "0")].join("-") } return result