1
Good morning I have a validation to do with Yup, and I need to make sure the initial interval is not longer than the final interval, anyone have any idea how to do that? I tried to pass the same variables in both fields of the schema, but it didn’t work.Follow the code:
const schema = yup.object().shape({
intervalo_inicial: yup.number().test('len',
'Valor deve ser maior que 0', v => v > 0.00 && v < 100.00).required(),
intervalo_final: yup.number().test('len',
'Valor deve ser menor que 100', v1 => v1 < 100.00 && v1 > 0.00).required(),
});```