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

Yup DateRange conditional validation #437

Open
bjnewman opened this issue Nov 16, 2021 · 0 comments
Open

Yup DateRange conditional validation #437

bjnewman opened this issue Nov 16, 2021 · 0 comments

Comments

@bjnewman
Copy link
Contributor

🐛 Bug report

Current Behavior

dateRange.when() conditional validations throw errors after upgrading yup to v0.32.11 and availity/yup to v4.0.0

see for example this partial schema that worked with availity/yup v3.1.1 and yup v0.29.3
image

will now throw an error that looks like
image

which I believe is due to this.format being undefined in the conditional validation so that getValidDate fails

as seen here
image

Expected behavior

This example test added to dateRange.test.js should pass and we should be able to continue validating dateRanges conditionally

image

Reproducible example

See test above

Suggested solution(s)

Working on it

Additional context

I already pinged Chris and Jordan about this and I have a bit of time to look into this more today and tomorrow so will update this issue if I find out anything useful.

Your environment

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant