calendarZonedDateTime
const calendarZonedDateTime: RegExp = /^(\d{4}|\+\d{6}|-(?!0{6})\d{6})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])T(\d{2}:\d{2}(?::\d{2}(?:[.,]\d{1,9})?)?)((?:[+-]\d{2}:\d{2}(?::\d{2}(?:[.,]\d{1,9})?)?)|Z)?\[(!?[^[\]=!]+)\]\[(!)?u-ca=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]$/;RegExp matching a calendar-annotated ZonedDateTime string in the RFC 9557 form Temporal writes and reads — the zoned sibling of calendarDate (regex/calendar-date.ts):
Examples
Section titled “Examples”import { calendarZonedDateTime } from "@northguild/gmt";calendarZonedDateTime.test("2024-02-24T14:30:00-05:00[America/New_York][u-ca=hebrew]") // truecalendarZonedDateTime.test("2024-02-24T14:30:00-05:00[u-ca=hebrew][America/New_York]") // false (calendar before zone)calendarZonedDateTime.test("2024-03-15T14:30:00Z[UTC]") // false (no calendar annotation)