Friday, February 23, 2024
 Popular · Latest · Hot · Upcoming
111
rated 0 times [  114] [ 3]  / answers: 1 / hits: 5566  / 5 Years ago, tue, september 24, 2019, 12:00:00

These are the commonly accepted ways of doing it in Javascript.



However with Typescript is we do !isNaN(someDate), typescript complains that we are using a method that accepts numbers, and not dates.



Thoughts on how to go about handling this?


More From » node.js

 Answers
3

a Date object is not an number, but you can use Date.getTime()



getTime() return a number value or NaN if the Date is not valid


[#6140] Saturday, September 21, 2019, 5 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rocioblancac

Total Points: 699
Total Questions: 96
Total Answers: 108

Location: Libya
Member since Mon, Dec 7, 2020
3 Years ago
;