Thanks Nick - Your validate function snippet is very useful and makes the node more robust in handling bad input. I've incorporated it into my new node-red-contrib node.
defaults: {
date: { value:0, required:true, validate: function(v) {
if (!/^\d{8}/.test(v)) { return false; }
var year = v.substring(0,4);
var month = v.substring(4,6);
var day = v.substring(6,8);
// Date.parse will return NaN if this isn't a valid date
var time = Date.parse(year+"-"+month+"-"+day);
return !isNaN(time);
}
}
}