Skip to main content

isISO8601Duration

Stentor API Reference


Stentor API Reference / stentor-utils/src / isISO8601Duration

Function: isISO8601Duration()

isISO8601Duration(potential): boolean

Defined in: packages/stentor-utils/src/date-time/isISO8601Duration.ts:18

Determine if the string is a proper ISO-8601 duration format.

https://stackoverflow.com/questions/32044846/regex-for-iso-8601-durations https://en.wikipedia.org/wiki/ISO_8601#Durations

Parameters​

potential​

string

Potential ISO-8601 duration string to test

Returns​

boolean

  • True if the provided string is a ISO-8601 duration formatted string.