isValidIsoDateLike
Signature
Section titled “Signature”isValidIsoDateLike(value: string): booleanisValidIsoDateLike(value: void | {} | null | undefined): booleanisValidIsoDateLike(value: unknown): value is stringReturn true when the input is a valid PlainDate or PlainDateTime ISO string.
- Accepts both PlainDate (“2024-02-29”) and PlainDateTime (“2024-02-29T12:34:56”) formats.
- The whole string must match
plainDateorplainDateTime. - Accepts no annotation of any kind: a time zone, a calendar (
[u-ca=iso8601]) or an elective one ([foo=bar]) returnsfalse. - Rejects leap seconds and invalid dates/times.
- A value that is not a string, a
Stringobject included, returnsfalse. Atrueresult narrows anunknownvalue tostring.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | string | any value; a string is checked as an ISO PlainDate or PlainDateTime |
Returns
Section titled “Returns”boolean indicating validity
Examples
Section titled “Examples”import { isValidIsoDateLike } from "@northguild/gmt/plain/validate";
isValidIsoDateLike("2024-02-29") // trueSource
Section titled “Source”Accessibility
© 2026 NorthGuild · Licences
Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.