This code:
var schema = Joi.object().keys({
date: Joi.date().allow(null)
});
Joi.assert({date: NaN}, schema);
prints in the console:
Error: {
"date" [1]: null
}
[1] "date" must be a number of milliseconds or valid date string
and could be really confusing to debug!