I have two date fields, start date, and end date. I would like to know how to set up a validation not to accept the start date to be higher than the end date and vice-versa.
Reading the yup documentation I saw the when condition, but it just gets values from other fields!
import { date, object } from 'yup';
export const yupSchema = object({
startAt: date().typeError('Invalid date').nullable(),
endAt: date().typeError('Invalid date').nullable(),
});
