tguard-js
    Preparing search index...

    Function isValidDate

    • Determines whether the provided value is a valid Date object.

      Parameters

      • x: unknown

        The value to be checked.

      Returns x is Date

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

      This function ensures that the value is a Date instance and that its internal time value is valid (i.e., not NaN).

      Value Result
      new Date() true
      new Date('invalid') false
      '2026-04-10' false
      Date.now() false

      1.0

      isDate