You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, Great wrok with zod. maybe i'm using it wrong but how would i parse a date in Api params i would get a string of Date and Zod expects a Date object. Should i use the zod.string() and parse the date in the backend?
The text was updated successfully, but these errors were encountered:
Yes, I'd recommend using a string field. If you want to verify that the string is, say, a valid ISO date string, then use a custom validator in combination with something like validator.js to enforce that. 👍
I wasn't initially planning to support Date schemas at all since they're not easily serializable but they were requested by multiple people. I think dealing with dates as ISO strings (until you actually need to display them in a human-readable format) is far more intuitive.
Hi, Great wrok with zod. maybe i'm using it wrong but how would i parse a date in Api params i would get a string of Date and Zod expects a Date object. Should i use the zod.string() and parse the date in the backend?
The text was updated successfully, but these errors were encountered: