Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yup date #7

Open
guilhermecostalopes opened this issue Sep 23, 2019 · 0 comments
Open

yup date #7

guilhermecostalopes opened this issue Sep 23, 2019 · 0 comments

Comments

@guilhermecostalopes
Copy link

https://www.npmjs.com/package/yup#date

jquense/yup#324

Estou tentando utilizar, mas não está validando as datas inicio e fim.

const validaFormAnaliseQuimica = yup.object().shape({
    dataFim: yup.date()
      .when(
        'dataInicio',
        (dataInicio: Date, schema: any) => (dataInicio && schema.min(dataInicio, "A Data Final deve ser maior do que a data inicial"))
      ),
    corrida: yup.string()
      .matches(/^[0-9]*$/, 'Deve-se inserir apenas números')
  })

O que estou fazendo de errado ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant