• Checks if the given value is a valid Date object. A valid date is an instance of Date and has a non-NaN time value.

    Parameters

    • date: unknown

      The value to check.

    Returns date is Date

    True if the value is a valid Date, otherwise false.

    // => true
    isValidDate(new Date())
    // => false
    isValidDate(new Date(NaN))
    // => false
    isValidDate('2014-02-31')