Date Validation end date must be greater or equal than start date using Yup
Hi I want to validate date in react using Yup I want that the end date should be equal or greater than the start date
This what I have did but its not working for the equal da开发者_C百科tes
const validationSchema = Yup.object().shape({
startDate: Yup.date().required('Please select start date'),
endDate: Yup.date().min(
Yup.ref('startDate'),
"end date can't be before start date"
),
});
精彩评论