I have this schema in Yup that puts a minimum date constraint on the date field:
Yup.date()
.required(strings.RequiredField(strings.Invoice_Label_DueDate))
.min(new Date(), "Date cannot be in the past")
But if I select the current date, it still computes it to be in the past. Note that this doesn't happen when I do max(new Date(), ...)
. In this case, it includes all past dates upto and including the current date.
Edit: Here's an example of the problem https://codesandbox.io/s/jznz5vl7lw