Skip to content

Instantly share code, notes, and snippets.

@nlf
Created November 18, 2014 19:24
Show Gist options
  • Save nlf/c53f3d99cf7689ecb895 to your computer and use it in GitHub Desktop.
Save nlf/c53f3d99cf7689ecb895 to your computer and use it in GitHub Desktop.
joi.js
var Joi = require('joi');
var obj = {
prop6: ["2015-06-07T14:21:46.295-07:00", "2015-06-07T18:21:46.295-07:00", "2015-06-07T20:21:46.295-07:00"]
}
var schema = Joi.object().keys({
prop6: Joi.array().includes(Joi.date().iso()).required()
});
console.log(Joi.validate(obj, schema))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment