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.

15 lines (13 loc) • 400 B
import { Temporal } from "../../internal/temporal.js"; import { epcisEventTime } from "../../regex/epcis.js"; // src/intermodal/validate/isValidEpcisEventTime.ts function isValidEpcisEventTime(value) { if (typeof value !== "string" || !epcisEventTime.test(value)) return false; try { Temporal.Instant.from(value); return true; } catch { return false; } } export { isValidEpcisEventTime };