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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With