Skip to content

isValidIsoDateLike

  • The core functions, which every industry uses.
isValidIsoDateLike(value: string): boolean
isValidIsoDateLike(value: void | {} | null | undefined): boolean
isValidIsoDateLike(value: unknown): value is string

Return 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 plainDate or plainDateTime.
  • Accepts no annotation of any kind: a time zone, a calendar ([u-ca=iso8601]) or an elective one ([foo=bar]) returns false.
  • Rejects leap seconds and invalid dates/times.
  • A value that is not a string, a String object included, returns false. A true result narrows an unknown value to string.
ParameterTypeDescription
valuestringany value; a string is checked as an ISO PlainDate or PlainDateTime

boolean indicating validity

import { isValidIsoDateLike } from "@northguild/gmt/plain/validate";
isValidIsoDateLike("2024-02-29") // true
output 

plain/validate/isValidIsoDateLike.ts

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.