UNPKG

@northguild/gmt

Version:

Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.

13 lines (11 loc) • 394 B
import { parseCalendarZonedValue } from "../../internal/calendarZonedString.js"; // src/zoned/validate/isValidCalendarZonedDateTime.ts function isValidCalendarZonedDateTime(value) { if (typeof value !== "string" || value.length === 0) return false; try { return parseCalendarZonedValue(value).timeZoneId.length > 0; } catch { return false; } } export { isValidCalendarZonedDateTime };