I need to check if a given string is a date object or not.
I originally used
Date.parse(val)
If you check Date.parse("07/28/2014 11:23:29 AM") , this will work.
But if you check Date.parse("hi there 1") , this will work too, which should not.
So, I changed my logic to
val instanceof Date
But for my string with a date of date "07/28/2014 11:23:29 AM" instanceof Date it returns false .
So, is there a way by which I can properly check my string for Date?
source share