Zod transform types
I have a zod type for our backend requirements that looks like this:
When I'm using that type through my code, it properly shows as a
Date
. When using that as a zod input on my trpc route, it's saying it's a string. I was assuming the transform isn't properly working since it's using dayjs but even just doing a straight transform to new Date()
still shows as a string. Is there a way to make this work? (There are deeper problems that adjusting the type to z.date() wouldn't work because the API expects a Date but passes back 'M/D/YYYY' string)1 Reply
I'm guessing you haven't set up a tRPC transformer?