Skip to content

duration

  • absDuration: Return the absolute value of an ISO 8601 duration string.
  • addDuration: Combine two ISO 8601 duration strings by addition.
  • durationAs: Express an ISO 8601 duration as a single fractional total in one unit.
  • getDurationSign: Report whether an ISO 8601 duration is negative, zero-length, or positive.
  • getDurationUnit: Read a single component out of an ISO 8601 duration string.
  • negateDuration: Flip the sign of an ISO 8601 duration string.
  • subtractDuration: Combine two ISO 8601 duration strings by subtraction.
  • formatDuration: Render an ISO 8601 duration string as a locale-aware, human-readable string.
  • normalizeDuration: Roll an ISO 8601 duration string’s small units into larger ones.
  • parseDuration: Parse and re-normalize an ISO 8601 duration string.
  • isValidDuration: Return true if value is a valid ISO 8601 duration string.