New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds a iso8601 helper function to parse a ISO Date String into a Date #5039
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the comment
@@ -58,6 +58,20 @@ export const recurringEventType = z | |||
}) | |||
.nullable(); | |||
|
|||
// dayjs iso parsing is very buggy - cant use :( - turns ISO string into Date object | |||
export const iso8601 = z.string().transform((val, ctx) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have some usage of it in place as well. Is it being used somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API 👍
Still mergeable, but recommended to have a usage
For use inside Zod schemas. Turns a valid ISO string into a date object and otherwise shows: