From f1074f6663b1310f66eac099d5dbfd5d4d8f9c63 Mon Sep 17 00:00:00 2001 From: lawvs <18554747+lawvs@users.noreply.github.com> Date: Wed, 7 Aug 2024 18:42:03 +0800 Subject: [PATCH] fix: serialization error for date --- packages/filter/src/views/data-input-views.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/filter/src/views/data-input-views.tsx b/packages/filter/src/views/data-input-views.tsx index 87bd739..53755e2 100644 --- a/packages/filter/src/views/data-input-views.tsx +++ b/packages/filter/src/views/data-input-views.tsx @@ -73,8 +73,11 @@ export const presetDataInputSpecs: DataInputViewSpec[] = [ if (!requiredDataSchema.length) { return null; } - const value = - (rule.args?.[0] as Date | undefined)?.toISOString().slice(0, 10) ?? ""; + + const value = rule.args?.[0] + ? new Date(rule.args?.[0] as Date).toISOString().slice(0, 10) + : ""; + return (