tguard-js
    Preparing search index...

    Function isDateString

    • Determines whether the provided value is a parseable date string.

      Parameters

      • x: unknown

        The value to be checked.

      Returns x is string

      true if the value is a parseable date string, otherwise false.

      This function checks whether a string can be parsed into a valid Date. It is more permissive than isISODateString, as it accepts non-ISO formats supported by the JavaScript engine.

      NOTE: Parsing behavior may vary between environments.

      Value Result
      '2026-04-10' true
      'April 10, 2026' true
      'invalid' false
      123 false

      1.0