1.0.0 • Published 1 year ago

tecsup-2023-tarea-ayoriach v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

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": "test@test.com",
    "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
1.0.0

1 year ago