Skip to content
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

Merged
merged 3 commits into from Oct 17, 2022

Conversation

emrysal
Copy link
Contributor

@emrysal emrysal commented Oct 16, 2022

For use inside Zod schemas. Turns a valid ISO string into a date object and otherwise shows:

image

@emrysal emrysal requested a review from a team October 16, 2022 23:26
@vercel
Copy link

vercel bot commented Oct 16, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cal ❌ Failed (Inspect) Oct 17, 2022 at 9:09AM (UTC)

Copy link
Member

@hariombalhara hariombalhara left a 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) => {
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API 👍

@hariombalhara hariombalhara dismissed their stale review October 17, 2022 06:16

Still mergeable, but recommended to have a usage

@emrysal emrysal enabled auto-merge (squash) October 17, 2022 08:53
@emrysal emrysal added ♻️ autoupdate tells kodiak to keep this branch up-to-date automerge labels Oct 17, 2022
@emrysal emrysal merged commit d8489a6 into main Oct 17, 2022
@emrysal emrysal deleted the feature/iso-date-helper-function branch October 17, 2022 09:07
@PeerRich PeerRich added the core area: core, team members only label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge ♻️ autoupdate tells kodiak to keep this branch up-to-date core area: core, team members only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants