diff options
Diffstat (limited to '')
-rw-r--r-- | examples/blog/src/content/config.ts (renamed from examples/with-content/src/content/config.ts) | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/with-content/src/content/config.ts b/examples/blog/src/content/config.ts index 30cbbf293..b4e86c9f7 100644 --- a/examples/with-content/src/content/config.ts +++ b/examples/blog/src/content/config.ts @@ -6,7 +6,10 @@ const blog = defineCollection({ title: z.string(), description: z.string(), // Transform string to Date object - pubDate: z.string().transform((str) => new Date(str)), + pubDate: z + .string() + .or(z.date()) + .transform((val) => new Date(val)), updatedDate: z .string() .optional() |