Skip to content

Date values and Yup Validation #282

Closed Answered by bdueck-oftr
bdueck-oftr asked this question in Q&A
Discussion options

You must be logged in to vote

Update on this. I was able to workaround the problem after I found the castValues option on the Yup validator. This handy feature uses Yup to automatically convert from string date values (yyyy-MM-dd type format like the value from an input date type control) to Date() objects. Still not ideal as I need a generic transformer to convert initialValues that will have Date type values into stringified yyyy-MM-dd format values as accepted by the html date control.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bdueck-oftr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant