How to find out if a Date is indeed a valid Date. Simply instance check will not do it, the date might be "Invalid Date".
Source code viewer
function isDate(date) { return date instanceof Date && !isNaN(date.getTime()); }Programming Language: Javascript