-
Notifications
You must be signed in to change notification settings - Fork 3
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
finalize feature/minMaxAge #7
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amanhã a gente conversa sobre essas mudanças. Existe um erro matemático nessa validação;
@@ -3,8 +3,24 @@ import utils from "../utils/utils"; | |||
export default (name, {value, condition, age}) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nesse arquivo aqui em cima tem uma importação não necessária
validations/age.js
Outdated
const birthDate = new Date(value); | ||
const today = new Date(); | ||
const localAge = today.getFullYear() - birthDate.getFullYear(); | ||
const month = today.getMonth() - birthDate.getMonth(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essa variável não está sendo usada
tests/validations/age.spec.js
Outdated
@@ -1,13 +1,139 @@ | |||
import validator from '../../index.js' | |||
|
|||
const now = (value) =>{ | |||
let today = new Date() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deveriam ser constantes
validations/age.js
Outdated
@@ -3,8 +3,24 @@ import utils from "../utils/utils"; | |||
export default (name, {value, condition, age}) => { | |||
let field = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deveria ser const
validations/age.js
Outdated
|
||
const birthDate = new Date(value); | ||
const today = new Date(); | ||
const localAge = today.getFullYear() - birthDate.getFullYear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Existe um erro matemático nessa linha, amanhã podemos conversar disso
validations/age.js
Outdated
} | ||
// '===', '>=', '<=', '<', '>', '!==' | ||
|
||
const birthDate = new Date(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nome dessas variáveis não está semântico
No description provided.