We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 940b028 commit 1a507daCopy full SHA for 1a507da
1 file changed
lib/validations.ts
@@ -21,10 +21,14 @@ export const EmailSchema = z.string().email().openapi({
21
description: "Valid email address",
22
});
23
24
-export const TimestampSchema = z.string().datetime().openapi({
25
- example: "2024-03-20T10:00:00Z",
26
- description: "ISO 8601 datetime string",
27
-});
+export const TimestampSchema = z
+ .string()
+ .datetime()
+ .transform((str) => new Date(str))
28
+ .openapi({
29
+ example: "2024-03-20T10:00:00Z",
30
+ description: "ISO 8601 datetime string",
31
+ });
32
33
// User Schemas
34
export const createUserSchema = z
0 commit comments