tecsup-2023-tarea-ayoriach
v1.0.0
Published
This is my task
Downloads
2
Readme
getAge("2004-10-01") or getAge("2004/10/01")
18
Any of these formats is acceptable
daysToChristmas()
264 days left until Christmas
form = {
"name": "test1",
"email": "[email protected]",
"password": "123456",
"birthday": "2010-10-10"
}
requireFields = ["email", "password"]
console.log(formValidator(form, requireFields))
true
form = {
"email": "testtestcom",
"password": "1256",
"birthday": "20asdfas10-10-10"
}
requireFields = ["email", "password", "name"]
console.log(formValidator(form, requireFields))
{
errors: {
name: 'Required',
email: 'Invalid email',
password: 'Password must be at least 6 characters long',
birthday: 'Invalid date format'
}
}
false