lib/index.js
function sanitizeDate(val) {
	if (!val) return null;
	if (_.isDate(val)) return val;
	if (_.isString(val)) return new Date(Date.parse(val));
	if (_.isNumber(val)) return new Date(val);
	if (_.isObject(val) && val.date) return sanitizeDate(val.date);
	return null;
}
function sanitizeDate(val) {
	if (!val) return null;
	if (_.isDate(val)) return val;
	if (_.isString(val)) return new Date(Date.parse(val));
	if (_.isNumber(val)) return new Date(val);
	if (_.isObject(val) && val.date) return sanitizeDate(val.date);
	return null;
}
function sanitizeDate ( val ) { if ( ! val ) return null ; if ( _ . isDate ( val ) ) return val ; if ( _ . isString ( val ) ) return new Date ( Date . parse ( val ) ) ; if ( _ . isNumber ( val ) ) return new Date ( val ) ; if ( _ . isObject ( val ) && val . date ) return sanitizeDate ( val . date ) ; return null ; }
Converts a date string, number of miliseconds or object with a date field into
an instance of Date. It will return the same instance if a Date instance is passed
in.

@method sanitizeDate
@parse {String|Number|Object} - the value to convert
@return {Date} - returns the converted Date instance
Converts a date string number of miliseconds or object with a date field into an instance of Date . It will return the same instance if a Date instance is passed in .