From 752ada722f1c2c5984feeb23489a4af14376a897 Mon Sep 17 00:00:00 2001 From: foyarash <11079152+foyarash@users.noreply.github.com> Date: Mon, 20 Nov 2023 17:26:40 +0100 Subject: [PATCH] Fix tests --- packages/next-admin/src/components/inputs/DateTimeWidget.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next-admin/src/components/inputs/DateTimeWidget.tsx b/packages/next-admin/src/components/inputs/DateTimeWidget.tsx index be80e9b2..2e32f181 100644 --- a/packages/next-admin/src/components/inputs/DateTimeWidget.tsx +++ b/packages/next-admin/src/components/inputs/DateTimeWidget.tsx @@ -23,7 +23,7 @@ export default function DateTimeWidget< const BaseInputTemplate = getTemplate<'BaseInputTemplate', T, S, F>('BaseInputTemplate', registry, options); const hiddenValue = useMemo(() => { - return new Date(value).toISOString() + return value ? new Date(value).toISOString() : new Date().toISOString() }, [value]) return (