Skip to content

Commit

Permalink
fix: serialization error for date
Browse files Browse the repository at this point in the history
  • Loading branch information
lawvs committed Aug 7, 2024
1 parent 715e792 commit f1074f6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/filter/src/views/data-input-views.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<InputView
ref={ref}
Expand Down

0 comments on commit f1074f6

Please sign in to comment.