Skip to main content

isISO8601

Stentor API Reference


Stentor API Reference / stentor-utils/src / isISO8601

Function: isISO8601()

isISO8601(potential): boolean

Defined in: packages/stentor-utils/src/dateTime.ts:108

Determines if the string is an ISO-8601 style string.

Parameters​

potential​

string

Potential ISO-8601 string

Returns​

boolean

  • True if the string is ISO-8601 Date & Time string

Remarks​

This does not cover the entire 8601 spec, just a version that is commonly used by NLUs to communicate date & time. For example, durations (like P1Y2M10D) are not supported.