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