koajs / joi-router

Configurable, input and output validated routing for koa
MIT License
450 stars 96 forks source link

date().iso() is wrongly claiming input is invalid #73

Open pke opened 5 years ago

pke commented 5 years ago

Using

validate: {
  type: "form",
  body: {
    start: Joi.date().iso().greater("now"),
  }
}

The form input of start="2018-10-10T10:00" or start="2018-10-10T10:00Z" both lead to

child "start" fails because ["start" must be a valid ISO 8601 date]

However Joi.validate("2018-10-10T10:00", Joi.date().iso().greater("now")) => error === null