@mindfulness/utils
    Preparing search index...

    Function isValid

    • Parameters

      • date: unknown

        The date to check

      Returns boolean

      The date is valid

      isValid

      Returns false if argument is Invalid Date and true otherwise. Argument is converted to Date using toDate. See toDate Invalid Date is a Date, whose time value is NaN.

      Time value of Date: http://es5.github.io/#x15.9.1.1

      // For the valid date:
      const result = isValid(new Date(2014, 1, 31))
      //=> true
      // For the value, convertible into a date:
      const result = isValid(1393804800000)
      //=> true
      // For the invalid date:
      const result = isValid(new Date(''))
      //=> false