date-is-invalid
Version:
Check if a date is invalid or not.
16 lines (14 loc) • 313 B
JavaScript
;
/**
* dateIsInvalid
* Check if a date is invalid or not.
*
* @name dateIsInvalid
* @function
* @param {Date} d The input date.
* @returns {Boolean} `true` if the date is invalid, `false` otherwise.
*/
module.exports = function dateIsInvalid(d) {
var t = d.getTime();
return t !== t;
};