js check if date object is invalid
const isValid = !Number.isNaN(new Date(timestamp).getTime())
js check if date object is invalid
const isValid = !Number.isNaN(new Date(timestamp).getTime())
js check invalid date
const validDate = !isNaN(Date.parse('foo'))
new date javascript invalid date
if (Object.prototype.toString.call(d) === "[object Date]") {
// it is a date
if (isNaN(d.getTime())) { // d.valueOf() could also work
// date is not valid
} else {
// date is valid
}
} else {
// not a date
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us