Skip to content

Commit c3493e7

Browse files
Xemahymc9
andauthored
fix date string zod validation (#355)
Co-authored-by: Yiming <yiming@whimslab.io>
1 parent 9f79e51 commit c3493e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/schema/src/plugins/zod/transformer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default class Transformer {
114114
} else if (inputType.type === 'Boolean') {
115115
result.push(this.wrapWithZodValidators('z.boolean()', field, inputType));
116116
} else if (inputType.type === 'DateTime') {
117-
result.push(this.wrapWithZodValidators('z.date()', field, inputType));
117+
result.push(this.wrapWithZodValidators('z.union([z.date(), z.string().datetime()])', field, inputType));
118118
} else if (inputType.type === 'Json') {
119119
this.hasJson = true;
120120

0 commit comments

Comments
 (0)