Fix custom date field validation failing on document edit#355
Conversation
mathieudutour
commented
Mar 24, 2026
- Fix custom date fields failing validation when editing existing documents. Date values from frontmatter are ISO strings, but z.date() rejects non-Date values. Changed to z.coerce.date() (matching the existing z.coerce.number() pattern) so strings are automatically coerced to Date objects during schema validation.
- Added test case verifying ISO date strings are coerced to Date objects.
|
@claude is attempting to deploy a commit to the andre Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: a5eceee The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
20b4a77 to
326b8ed
Compare
|
Hey @mathieudutour the PR describes one thing but it seems to do another. I like the idea of an iframe or youtube block, but not necessarily having it be a settings option. |
7686d93 to
7662940
Compare
|
ah yep sorry, pushed something else on the branch. When editing a document that has a custom field of type date, you can't save it until you reenter the date in the custom field: it says that the field is of the wrong type (string instead of Date) The youtube thing wasn't quite ready, it's on another PR here mathieudutour#4 if you'd like. Regarding the setting for it, I thought it'd be nicer because it requires some specific handling from the consumer - but if you think it's better by default, go for it |
|
@mathieudutour thank you! Merged |