UNPKG

date-is-invalid

Version:
16 lines (14 loc) 313 B
"use strict"; /** * 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; };