Answers for "new date javascript invalid date"

0

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
}
Posted by: Guest on May-26-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language