And it turns out that new Date() is when the code was built and deployed so when we had a code freeze over christmas we came back to a bunch of people getting errors haha
So now I know I should be using Yup.lazy() as it says
Creates a schema that is evaluated at validation/cast time
However it's not really made clear in the docs / getting started guide. Maybe a warning or something along those lines higher up the readme might be useful?
Or if it is actually obvious and I just didn't read the docs properly then a mention could maybe be added here
https://github.com/jquense/yup/#date
So it appears I've run into this issue https://stackoverflow.com/questions/63381887/yup-compares-min-max-date-with-build-date-instead-of-current-date
I was running my schema validation on the client and in the nextjs server side code which was
And it turns out that
new Date()
is when the code was built and deployed so when we had a code freeze over christmas we came back to a bunch of people getting errors hahaSo now I know I should be using Yup.lazy() as it says
However it's not really made clear in the docs / getting started guide. Maybe a warning or something along those lines higher up the readme might be useful?
Or if it is actually obvious and I just didn't read the docs properly then a mention could maybe be added here https://github.com/jquense/yup/#date
Thanks!