@northguild/gmt 1.14.2 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -13
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/plain/calculate/diffDateAsDuration.js +1 -1
- package/dist/plain/calculate/index.d.ts +2 -1
- package/dist/plain/calculate/index.js +2 -1
- package/dist/plain/calculate/{weekOfYear.d.ts → weekOfYearForDate.d.ts} +0 -14
- package/dist/plain/calculate/weekOfYearForDate.js +28 -0
- package/dist/plain/calculate/weekOfYearForDateTime.d.ts +14 -0
- package/dist/plain/calculate/{weekOfYear.js → weekOfYearForDateTime.js} +1 -27
- package/dist/plain/format/formatCalendar.d.ts +2 -2
- package/dist/plain/format/formatDate.d.ts +3 -2
- package/dist/plain/format/formatDate.js +1 -1
- package/dist/plain/format/formatDateRange.d.ts +3 -2
- package/dist/plain/format/formatDateRange.js +1 -1
- package/dist/plain/format/formatDateTime.d.ts +3 -2
- package/dist/plain/format/formatDateTime.js +1 -1
- package/dist/plain/format/formatDateTimeRange.d.ts +3 -2
- package/dist/plain/format/formatDateTimeRange.js +1 -1
- package/dist/plain/format/formatDateTimeToParts.d.ts +3 -2
- package/dist/plain/format/formatDateTimeToParts.js +1 -1
- package/dist/plain/format/formatDateToParts.d.ts +3 -2
- package/dist/plain/format/formatDateToParts.js +1 -1
- package/dist/plain/format/formatRelativeDate.d.ts +3 -14
- package/dist/plain/format/formatRelativeDateTime.d.ts +3 -14
- package/dist/plain/format/formatRelativeTime.d.ts +3 -14
- package/dist/plain/format/formatTime.d.ts +2 -1
- package/dist/plain/get/getNowUnit.d.ts +2 -3
- package/dist/plain/interval/splitIntervalByUnitDate.js +1 -1
- package/dist/regex/calendar-date.d.ts +19 -0
- package/dist/regex/calendar-date.js +19 -10
- package/dist/regex/calendar-zoned-date-time.d.ts +45 -0
- package/dist/regex/calendar-zoned-date-time.js +45 -40
- package/dist/regex/date-time.d.ts +18 -0
- package/dist/regex/date-time.js +18 -1
- package/dist/regex/date.d.ts +16 -0
- package/dist/regex/date.js +16 -1
- package/dist/regex/http-date.d.ts +15 -0
- package/dist/regex/http-date.js +15 -6
- package/dist/regex/leap-second.d.ts +12 -0
- package/dist/regex/leap-second.js +12 -1
- package/dist/regex/rfc-2822.d.ts +18 -0
- package/dist/regex/rfc-2822.js +18 -8
- package/dist/regex/rfc-3339.d.ts +19 -0
- package/dist/regex/rfc-3339.js +19 -6
- package/dist/regex/sql-date-time.d.ts +14 -0
- package/dist/regex/sql-date-time.js +14 -6
- package/dist/regex/time-zone-like.d.ts +21 -0
- package/dist/regex/time-zone-like.js +21 -0
- package/dist/regex/time.d.ts +59 -0
- package/dist/regex/time.js +59 -3
- package/dist/regex/unix.d.ts +21 -0
- package/dist/regex/unix.js +21 -0
- package/dist/regex/utc-date-time.d.ts +20 -0
- package/dist/regex/utc-date-time.js +20 -1
- package/dist/types/calendar-options.d.ts +11 -0
- package/dist/types/calendar-options.js +0 -0
- package/dist/types/datetime-format-options.d.ts +6 -0
- package/dist/types/datetime-format-options.js +0 -0
- package/dist/types/duration-unit.d.ts +5 -0
- package/dist/types/duration-unit.js +0 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.js +11 -0
- package/dist/types/now-unit.d.ts +5 -0
- package/dist/types/now-unit.js +0 -0
- package/dist/types/relative-date-time-unit.d.ts +6 -0
- package/dist/types/relative-date-time-unit.js +0 -0
- package/dist/types/relative-date-unit.d.ts +5 -0
- package/dist/types/relative-date-unit.js +0 -0
- package/dist/types/relative-time-options.d.ts +18 -0
- package/dist/types/relative-time-options.js +0 -0
- package/dist/types/relative-time-unit.d.ts +5 -0
- package/dist/types/relative-time-unit.js +0 -0
- package/dist/types/relative-unit.d.ts +6 -0
- package/dist/types/relative-unit.js +0 -0
- package/dist/types/unix-now-unit.d.ts +5 -0
- package/dist/types/unix-now-unit.js +0 -0
- package/dist/types/utc-now-unit.d.ts +5 -0
- package/dist/types/utc-now-unit.js +0 -0
- package/dist/unix/calculate/startOrEndOfUnix.d.ts +18 -0
- package/dist/unix/calculate/startOrEndOfUnix.js +18 -0
- package/dist/unix/format/formatCalendarUnix.d.ts +27 -1
- package/dist/unix/format/formatRelativeUnix.d.ts +1 -8
- package/dist/unix/format/formatUnix.d.ts +19 -0
- package/dist/unix/format/formatUnix.js +19 -0
- package/dist/unix/get/getUnixNowUnit.d.ts +2 -3
- package/dist/unix/parse/parseUnitFromUnix.d.ts +24 -0
- package/dist/unix/validate/isValidUnixUnit.d.ts +15 -0
- package/dist/utc/calculate/startOrEndOfUtc.d.ts +17 -0
- package/dist/utc/calculate/startOrEndOfUtc.js +17 -0
- package/dist/utc/format/formatCalendarUtc.d.ts +2 -2
- package/dist/utc/format/formatRelativeUtc.d.ts +2 -12
- package/dist/utc/format/formatUtc.d.ts +33 -0
- package/dist/utc/format/formatUtc.js +17 -0
- package/dist/utc/get/getUtcNowUnit.d.ts +2 -3
- package/dist/utc/parse/parseUnitFromUtc.d.ts +23 -0
- package/dist/zoned/format/formatRelativeZoned.d.ts +1 -8
- package/dist/zoned/format/formatTimeZoneName.d.ts +15 -0
- package/dist/zoned/format/formatZonedDateTime.d.ts +2 -1
- package/dist/zoned/format/formatZonedRange.d.ts +2 -1
- package/dist/zoned/format/formatZonedToParts.d.ts +2 -1
- package/dist/zoned/get/getDstTransitions.d.ts +18 -2
- package/dist/zoned/get/getZonedNowUnit.d.ts +24 -0
- package/dist/zoned/interval/intervalDifferenceZoned.d.ts +3 -3
- package/dist/zoned/interval/intervalDifferenceZoned.js +3 -3
- package/dist/zoned/interval/intervalXorZoned.d.ts +6 -4
- package/dist/zoned/interval/intervalXorZoned.js +6 -4
- package/dist/zoned/parse/getZonedOffsetAs.d.ts +11 -0
- package/dist/zoned/parse/parseUnitFromZoned.d.ts +24 -0
- package/package.json +25 -7
- package/skills/gmt-arithmetic/SKILL.md +83 -0
- package/skills/gmt-basics/SKILL.md +80 -0
- package/skills/gmt-integration/SKILL.md +73 -0
- package/skills/gmt-timezone/SKILL.md +80 -0
- package/skills/_artifacts/domain_map.yaml +0 -547
- package/skills/_artifacts/skill_spec.md +0 -67
- package/skills/_artifacts/skill_tree.yaml +0 -278
- package/skills/api-expansion-workflow/SKILL.md +0 -52
- package/skills/app-integration/SKILL.md +0 -38
- package/skills/calculate-dates/SKILL.md +0 -432
- package/skills/compare-dates/SKILL.md +0 -412
- package/skills/convert-types/SKILL.md +0 -305
- package/skills/durations/SKILL.md +0 -418
- package/skills/format-date-time/SKILL.md +0 -486
- package/skills/format-date-time/references/format-api.md +0 -34
- package/skills/format-relative-time/SKILL.md +0 -223
- package/skills/get-current/SKILL.md +0 -229
- package/skills/interval-ops/SKILL.md +0 -432
- package/skills/issue-creation/SKILL.md +0 -118
- package/skills/lint-package-suggestion/SKILL.md +0 -37
- package/skills/new-method-implementation/SKILL.md +0 -71
- package/skills/parse-date-time/SKILL.md +0 -349
- package/skills/pr-contribution/SKILL.md +0 -180
- package/skills/unit-test-generation/SKILL.md +0 -56
- package/skills/validate-dates/SKILL.md +0 -438
- package/skills/zoned-date-ops/SKILL.md +0 -422
- package/skills/zoned-date-ops/references/timezones.md +0 -13
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
/**
|
|
2
|
+
* RegExp matching GMT's own calendar-annotated PlainDate string: the calendar-native
|
|
3
|
+
* year/month/day (e.g. Hebrew year 5785), tagged with the calendar identifier — not
|
|
4
|
+
* Temporal's own `[u-ca=...]` annotation convention, which keeps the ISO/proleptic-
|
|
5
|
+
* Gregorian digits and only tags the calendar. See `convertDateToCalendar` for the
|
|
6
|
+
* rationale.
|
|
7
|
+
*
|
|
8
|
+
* The optional trailing `;era=<name>` captures an era identifier (e.g. "reiwa"), needed
|
|
9
|
+
* only for the "japanese" calendar: unlike every other supported calendar, Temporal's
|
|
10
|
+
* `.year` for "japanese" stays proleptic (does not reset at an era change), so the
|
|
11
|
+
* era-relative year (Temporal's `.eraYear`) has to be paired with the era name to be
|
|
12
|
+
* unambiguous. See `formatCalendarDate`/`parseCalendarDateValue` for how it round-trips.
|
|
13
|
+
*
|
|
14
|
+
* Capture groups: 1 year, 2 month, 3 day, 4 calendar id, 5 era (optional).
|
|
15
|
+
*
|
|
16
|
+
* @example calendarDate.test("5785-01-01[u-ca=hebrew]") // true
|
|
17
|
+
* @example calendarDate.test("5785-01-01[u-ca=japanese;era=reiwa]") // true
|
|
18
|
+
* @example calendarDate.test("2024-03-15") // false (no calendar tag)
|
|
19
|
+
*/
|
|
11
20
|
export const calendarDate = /^(\d{4,6})-(\d{2})-(\d{2})\[u-ca=([a-z][a-z0-9-]*)(?:;era=([a-z]+))?\]$/;
|
|
@@ -1 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RegExp matching GMT's own calendar-annotated ZonedDateTime string — the zoned sibling of
|
|
3
|
+
* `calendarDate` (regex/calendar-date.ts). Shape:
|
|
4
|
+
*
|
|
5
|
+
* <calendar-native-date>T<time><offset>[u-ca=<id>[;era=<era>]][<timeZone>]
|
|
6
|
+
* 5784-06-15T14:30:00-05:00[u-ca=hebrew][America/New_York]
|
|
7
|
+
* 0031-04-30T12:00:00+09:00[u-ca=japanese;era=heisei][Asia/Tokyo]
|
|
8
|
+
*
|
|
9
|
+
* The date half (`(\d{4,6})-(\d{2})-(\d{2})`) and the annotation half
|
|
10
|
+
* (`\[u-ca=([a-z][a-z0-9-]*)(?:;era=([a-z]+))?\]`) are deliberately byte-identical to
|
|
11
|
+
* `calendarDate`'s, so the two grammars cannot drift apart —
|
|
12
|
+
* `calendar-zoned-date-time.test.ts` asserts every `convertDateToCalendar` output splices
|
|
13
|
+
* into this pattern.
|
|
14
|
+
*
|
|
15
|
+
* SEGMENT ORDERING: `[u-ca=...]` comes BEFORE `[timeZone]` — the reverse of RFC 9557.
|
|
16
|
+
* This is deliberate and load-bearing, not an oversight, and it must not be "fixed" to
|
|
17
|
+
* match Temporal's own string convention. Verified against @js-temporal/polyfill@0.5.1:
|
|
18
|
+
*
|
|
19
|
+
* 1. GMT's digits are calendar-native (Hebrew year 5784, not ISO year 5784), so a GMT
|
|
20
|
+
* string is never a valid RFC 9557 string — round-trippability through
|
|
21
|
+
* `Temporal.ZonedDateTime.from` was never achievable, and the `;era=` suffix makes it
|
|
22
|
+
* impossible regardless of ordering.
|
|
23
|
+
* 2. RFC 9557's own ordering is actively dangerous here.
|
|
24
|
+
* `Temporal.ZonedDateTime.from("5784-01-01T14:30:00-05:00[America/New_York][u-ca=hebrew]")`
|
|
25
|
+
* SUCCEEDS, silently reading `5784-01-01` as ISO year 5784 — a ~3760-year misparse
|
|
26
|
+
* with no error. GMT's ordering makes that same shape uniformly rejected:
|
|
27
|
+
* `Temporal.ZonedDateTime.from("...-05:00[u-ca=hebrew][America/New_York]")` throws
|
|
28
|
+
* `RangeError: invalid RFC 9557 string` for all 13 calendars.
|
|
29
|
+
* 3. `isValidZonedDateTime` is imported by ~90 non-test files, only ~18 of which are in
|
|
30
|
+
* scope. With `[u-ca=]` first, every out-of-scope function fails closed (returns its
|
|
31
|
+
* sentinel) rather than silently returning an answer computed against the wrong calendar.
|
|
32
|
+
*
|
|
33
|
+
* The offset stays between the time and the bracketed tail, so `<date>T<time><offset>`
|
|
34
|
+
* remains a contiguous, familiar ISO-8601 head; only the bracketed tail reorders.
|
|
35
|
+
*
|
|
36
|
+
* Capture groups: 1 year, 2 month, 3 day, 4 time, 5 offset (optional), 6 calendar id,
|
|
37
|
+
* 7 era (optional), 8 time zone. As with every GMT grammar regex, a match proves SHAPE
|
|
38
|
+
* ONLY — real field/calendar/era/zone validation is delegated to
|
|
39
|
+
* `Temporal.*.from(fields, { overflow: "reject" })` in `internal/calendarZonedString.ts`
|
|
40
|
+
* (see `context/coding-standards.md`'s scoped manual-string-parsing exception, rule 2).
|
|
41
|
+
*
|
|
42
|
+
* @example calendarZonedDateTime.test("5784-06-15T14:30:00-05:00[u-ca=hebrew][America/New_York]") // true
|
|
43
|
+
* @example calendarZonedDateTime.test("0031-04-30T12:00:00+09:00[u-ca=japanese;era=heisei][Asia/Tokyo]") // true
|
|
44
|
+
* @example calendarZonedDateTime.test("2024-03-15T14:30:00Z") // false (no calendar tag)
|
|
45
|
+
*/
|
|
1
46
|
export declare const calendarZonedDateTime: RegExp;
|
|
@@ -1,41 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
/**
|
|
2
|
+
* RegExp matching GMT's own calendar-annotated ZonedDateTime string — the zoned sibling of
|
|
3
|
+
* `calendarDate` (regex/calendar-date.ts). Shape:
|
|
4
|
+
*
|
|
5
|
+
* <calendar-native-date>T<time><offset>[u-ca=<id>[;era=<era>]][<timeZone>]
|
|
6
|
+
* 5784-06-15T14:30:00-05:00[u-ca=hebrew][America/New_York]
|
|
7
|
+
* 0031-04-30T12:00:00+09:00[u-ca=japanese;era=heisei][Asia/Tokyo]
|
|
8
|
+
*
|
|
9
|
+
* The date half (`(\d{4,6})-(\d{2})-(\d{2})`) and the annotation half
|
|
10
|
+
* (`\[u-ca=([a-z][a-z0-9-]*)(?:;era=([a-z]+))?\]`) are deliberately byte-identical to
|
|
11
|
+
* `calendarDate`'s, so the two grammars cannot drift apart —
|
|
12
|
+
* `calendar-zoned-date-time.test.ts` asserts every `convertDateToCalendar` output splices
|
|
13
|
+
* into this pattern.
|
|
14
|
+
*
|
|
15
|
+
* SEGMENT ORDERING: `[u-ca=...]` comes BEFORE `[timeZone]` — the reverse of RFC 9557.
|
|
16
|
+
* This is deliberate and load-bearing, not an oversight, and it must not be "fixed" to
|
|
17
|
+
* match Temporal's own string convention. Verified against @js-temporal/polyfill@0.5.1:
|
|
18
|
+
*
|
|
19
|
+
* 1. GMT's digits are calendar-native (Hebrew year 5784, not ISO year 5784), so a GMT
|
|
20
|
+
* string is never a valid RFC 9557 string — round-trippability through
|
|
21
|
+
* `Temporal.ZonedDateTime.from` was never achievable, and the `;era=` suffix makes it
|
|
22
|
+
* impossible regardless of ordering.
|
|
23
|
+
* 2. RFC 9557's own ordering is actively dangerous here.
|
|
24
|
+
* `Temporal.ZonedDateTime.from("5784-01-01T14:30:00-05:00[America/New_York][u-ca=hebrew]")`
|
|
25
|
+
* SUCCEEDS, silently reading `5784-01-01` as ISO year 5784 — a ~3760-year misparse
|
|
26
|
+
* with no error. GMT's ordering makes that same shape uniformly rejected:
|
|
27
|
+
* `Temporal.ZonedDateTime.from("...-05:00[u-ca=hebrew][America/New_York]")` throws
|
|
28
|
+
* `RangeError: invalid RFC 9557 string` for all 13 calendars.
|
|
29
|
+
* 3. `isValidZonedDateTime` is imported by ~90 non-test files, only ~18 of which are in
|
|
30
|
+
* scope. With `[u-ca=]` first, every out-of-scope function fails closed (returns its
|
|
31
|
+
* sentinel) rather than silently returning an answer computed against the wrong calendar.
|
|
32
|
+
*
|
|
33
|
+
* The offset stays between the time and the bracketed tail, so `<date>T<time><offset>`
|
|
34
|
+
* remains a contiguous, familiar ISO-8601 head; only the bracketed tail reorders.
|
|
35
|
+
*
|
|
36
|
+
* Capture groups: 1 year, 2 month, 3 day, 4 time, 5 offset (optional), 6 calendar id,
|
|
37
|
+
* 7 era (optional), 8 time zone. As with every GMT grammar regex, a match proves SHAPE
|
|
38
|
+
* ONLY — real field/calendar/era/zone validation is delegated to
|
|
39
|
+
* `Temporal.*.from(fields, { overflow: "reject" })` in `internal/calendarZonedString.ts`
|
|
40
|
+
* (see `context/coding-standards.md`'s scoped manual-string-parsing exception, rule 2).
|
|
41
|
+
*
|
|
42
|
+
* @example calendarZonedDateTime.test("5784-06-15T14:30:00-05:00[u-ca=hebrew][America/New_York]") // true
|
|
43
|
+
* @example calendarZonedDateTime.test("0031-04-30T12:00:00+09:00[u-ca=japanese;era=heisei][Asia/Tokyo]") // true
|
|
44
|
+
* @example calendarZonedDateTime.test("2024-03-15T14:30:00Z") // false (no calendar tag)
|
|
45
|
+
*/
|
|
41
46
|
export const calendarZonedDateTime = /^(\d{4,6})-(\d{2})-(\d{2})T(\d{2}:\d{2}(?::\d{2}(?:[.,]\d{1,9})?)?)((?:[+-]\d{2}:\d{2}(?::\d{2}(?:[.,]\d{1,9})?)?)|[Zz])?\[u-ca=([a-z][a-z0-9-]*)(?:;era=([a-z]+))?\]\[([^[\]]+)\]$/;
|
|
@@ -1 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RegExp matching ISO 8601 local date-time (extended): `<date>T<time>`.
|
|
3
|
+
*
|
|
4
|
+
* - Date half: `YYYY-MM-DD` or `±YYYYYY-MM-DD` (6-digit year with sign).
|
|
5
|
+
* - Time half: `HH:mm` with optional `:ss[.fffffffff]` (fractional seconds use `.` or `,`).
|
|
6
|
+
* - No timezone designator — this is a plain/local date-time only.
|
|
7
|
+
* - Shape-only validation; real calendar validation is delegated to
|
|
8
|
+
* `Temporal.PlainDateTime.from` in `parseDateTime`.
|
|
9
|
+
*
|
|
10
|
+
* Capture groups: 1 year, 2 month, 3 day, 4 hour, 5 minute, 6 second (optional),
|
|
11
|
+
* 7 fractional (optional).
|
|
12
|
+
*
|
|
13
|
+
* @example plainDateTime.test("2024-03-15T14:30:00") // true
|
|
14
|
+
* @example plainDateTime.test("2024-03-15T14:30") // true (seconds omitted)
|
|
15
|
+
* @example plainDateTime.test("+000031-04-30T12:00:00.123") // true (6-digit year)
|
|
16
|
+
* @example plainDateTime.test("2024-03-15 14:30:00") // false (space separator)
|
|
17
|
+
* @example plainDateTime.test("2024-03-15T14:30:00Z") // false (has timezone)
|
|
18
|
+
*/
|
|
1
19
|
export declare const plainDateTime: RegExp;
|
package/dist/regex/date-time.js
CHANGED
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* RegExp matching ISO 8601 local date-time (extended): `<date>T<time>`.
|
|
3
|
+
*
|
|
4
|
+
* - Date half: `YYYY-MM-DD` or `±YYYYYY-MM-DD` (6-digit year with sign).
|
|
5
|
+
* - Time half: `HH:mm` with optional `:ss[.fffffffff]` (fractional seconds use `.` or `,`).
|
|
6
|
+
* - No timezone designator — this is a plain/local date-time only.
|
|
7
|
+
* - Shape-only validation; real calendar validation is delegated to
|
|
8
|
+
* `Temporal.PlainDateTime.from` in `parseDateTime`.
|
|
9
|
+
*
|
|
10
|
+
* Capture groups: 1 year, 2 month, 3 day, 4 hour, 5 minute, 6 second (optional),
|
|
11
|
+
* 7 fractional (optional).
|
|
12
|
+
*
|
|
13
|
+
* @example plainDateTime.test("2024-03-15T14:30:00") // true
|
|
14
|
+
* @example plainDateTime.test("2024-03-15T14:30") // true (seconds omitted)
|
|
15
|
+
* @example plainDateTime.test("+000031-04-30T12:00:00.123") // true (6-digit year)
|
|
16
|
+
* @example plainDateTime.test("2024-03-15 14:30:00") // false (space separator)
|
|
17
|
+
* @example plainDateTime.test("2024-03-15T14:30:00Z") // false (has timezone)
|
|
18
|
+
*/
|
|
2
19
|
export const plainDateTime = /^(?:\d{4}|[+-]\d{6})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:[.,][0-9]{1,9})?)?$/;
|
package/dist/regex/date.d.ts
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
export declare const year: RegExp;
|
|
2
2
|
export declare const month: RegExp;
|
|
3
3
|
export declare const day: RegExp;
|
|
4
|
+
/**
|
|
5
|
+
* RegExp matching ISO 8601 calendar date (extended): `YYYY-MM-DD` or `±YYYYYY-MM-DD`.
|
|
6
|
+
*
|
|
7
|
+
* - Year: 4-digit (`2024`) or 6-digit with sign (`+000031` / `-000031`).
|
|
8
|
+
* - Month: `01`–`12`, zero-padded.
|
|
9
|
+
* - Day: `01`–`31`, zero-padded (shape-only; real calendar validation is delegated to
|
|
10
|
+
* `Temporal.PlainDate.from` in `parseDate`).
|
|
11
|
+
*
|
|
12
|
+
* Capture groups: 1 year, 2 month, 3 day.
|
|
13
|
+
*
|
|
14
|
+
* @example plainDate.test("2024-03-15") // true
|
|
15
|
+
* @example plainDate.test("+000031-04-30") // true (6-digit year)
|
|
16
|
+
* @example plainDate.test("-000031-04-30") // true (negative 6-digit year)
|
|
17
|
+
* @example plainDate.test("2024-3-15") // false (unpadded month)
|
|
18
|
+
* @example plainDate.test("2024-03-00") // false (day zero)
|
|
19
|
+
*/
|
|
4
20
|
export declare const plainDate: RegExp;
|
package/dist/regex/date.js
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
export const year = /^(?:\d{4}|[+-]\d{6})$/;
|
|
2
2
|
export const month = /^(0[1-9]|1[0-2])$/;
|
|
3
3
|
export const day = /^(0[1-9]|[12][0-9]|3[01])$/;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* RegExp matching ISO 8601 calendar date (extended): `YYYY-MM-DD` or `±YYYYYY-MM-DD`.
|
|
6
|
+
*
|
|
7
|
+
* - Year: 4-digit (`2024`) or 6-digit with sign (`+000031` / `-000031`).
|
|
8
|
+
* - Month: `01`–`12`, zero-padded.
|
|
9
|
+
* - Day: `01`–`31`, zero-padded (shape-only; real calendar validation is delegated to
|
|
10
|
+
* `Temporal.PlainDate.from` in `parseDate`).
|
|
11
|
+
*
|
|
12
|
+
* Capture groups: 1 year, 2 month, 3 day.
|
|
13
|
+
*
|
|
14
|
+
* @example plainDate.test("2024-03-15") // true
|
|
15
|
+
* @example plainDate.test("+000031-04-30") // true (6-digit year)
|
|
16
|
+
* @example plainDate.test("-000031-04-30") // true (negative 6-digit year)
|
|
17
|
+
* @example plainDate.test("2024-3-15") // false (unpadded month)
|
|
18
|
+
* @example plainDate.test("2024-03-00") // false (day zero)
|
|
19
|
+
*/
|
|
5
20
|
export const plainDate = /^(?:\d{4}|[+-]\d{6})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/;
|
|
@@ -1 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RegExp matching RFC 7231 §7.1.1.1 IMF-fixdate — the only form GMT's `formatHttp`
|
|
3
|
+
* emits, and the only form `parseHttp` accepts. Day, year, and time-of-day fields are
|
|
4
|
+
* all fixed-width per the grammar (unlike RFC 2822's leniently-sized day); the trailing
|
|
5
|
+
* "GMT" literal is mandatory, never a numeric offset. The obsolete RFC 850 and asctime
|
|
6
|
+
* HTTP-date forms are a documented limitation (see `parseHttp`'s JSDoc), not supported
|
|
7
|
+
* here.
|
|
8
|
+
*
|
|
9
|
+
* Capture groups: 1 day-of-week, 2 day, 3 month, 4 year, 5 hour, 6 minute, 7 second.
|
|
10
|
+
*
|
|
11
|
+
* @example httpDate.test("Wed, 09 Jun 2021 10:18:14 GMT") // true
|
|
12
|
+
* @example httpDate.test("Jun 09 2021 10:18:14 GMT") // false (missing day-of-week)
|
|
13
|
+
* @example httpDate.test("Wed, 9 Jun 2021 10:18:14 GMT") // false (single-digit day)
|
|
14
|
+
* @example httpDate.test("Wed, 09 Jun 2021 10:18:14 +0000") // false (numeric offset)
|
|
15
|
+
*/
|
|
1
16
|
export declare const httpDate: RegExp;
|
package/dist/regex/http-date.js
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* RegExp matching RFC 7231 §7.1.1.1 IMF-fixdate — the only form GMT's `formatHttp`
|
|
3
|
+
* emits, and the only form `parseHttp` accepts. Day, year, and time-of-day fields are
|
|
4
|
+
* all fixed-width per the grammar (unlike RFC 2822's leniently-sized day); the trailing
|
|
5
|
+
* "GMT" literal is mandatory, never a numeric offset. The obsolete RFC 850 and asctime
|
|
6
|
+
* HTTP-date forms are a documented limitation (see `parseHttp`'s JSDoc), not supported
|
|
7
|
+
* here.
|
|
8
|
+
*
|
|
9
|
+
* Capture groups: 1 day-of-week, 2 day, 3 month, 4 year, 5 hour, 6 minute, 7 second.
|
|
10
|
+
*
|
|
11
|
+
* @example httpDate.test("Wed, 09 Jun 2021 10:18:14 GMT") // true
|
|
12
|
+
* @example httpDate.test("Jun 09 2021 10:18:14 GMT") // false (missing day-of-week)
|
|
13
|
+
* @example httpDate.test("Wed, 9 Jun 2021 10:18:14 GMT") // false (single-digit day)
|
|
14
|
+
* @example httpDate.test("Wed, 09 Jun 2021 10:18:14 +0000") // false (numeric offset)
|
|
15
|
+
*/
|
|
7
16
|
export const httpDate = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{2}):(\d{2}):(\d{2}) GMT$/;
|
|
@@ -1 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RegExp fragment matching an ISO 8601 leap second: `T HH:mm:60[.fff]` followed by
|
|
3
|
+
* a timezone designator (`Z`, numeric offset, or `[` opening a bracketed annotation).
|
|
4
|
+
*
|
|
5
|
+
* - Detects second = 60 within a date-time string, not a full standalone value.
|
|
6
|
+
* - Used to identify and reject (or flag) leap-second values before Temporal parsing.
|
|
7
|
+
*
|
|
8
|
+
* @example leapSecond.test("2024-12-31T23:59:60Z") // true
|
|
9
|
+
* @example leapSecond.test("2024-12-31T23:59:60.123+00:00") // true
|
|
10
|
+
* @example leapSecond.test("2024-12-31T23:59:59Z") // false (second = 59)
|
|
11
|
+
* @example leapSecond.test("2024-12-31T23:59:60") // false (no zone designator)
|
|
12
|
+
*/
|
|
1
13
|
export declare const leapSecond: RegExp;
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* RegExp fragment matching an ISO 8601 leap second: `T HH:mm:60[.fff]` followed by
|
|
3
|
+
* a timezone designator (`Z`, numeric offset, or `[` opening a bracketed annotation).
|
|
4
|
+
*
|
|
5
|
+
* - Detects second = 60 within a date-time string, not a full standalone value.
|
|
6
|
+
* - Used to identify and reject (or flag) leap-second values before Temporal parsing.
|
|
7
|
+
*
|
|
8
|
+
* @example leapSecond.test("2024-12-31T23:59:60Z") // true
|
|
9
|
+
* @example leapSecond.test("2024-12-31T23:59:60.123+00:00") // true
|
|
10
|
+
* @example leapSecond.test("2024-12-31T23:59:59Z") // false (second = 59)
|
|
11
|
+
* @example leapSecond.test("2024-12-31T23:59:60") // false (no zone designator)
|
|
12
|
+
*/
|
|
2
13
|
export const leapSecond = /T\d{2}:\d{2}:60(?:[.,]\d+)?(?:[-+Zz[])/;
|
package/dist/regex/rfc-2822.d.ts
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RegExp matching RFC 5322 §3.3 date-time grammar (obsoletes RFC 2822, same shape).
|
|
3
|
+
* English day/month names are mandated by the spec regardless of locale — see
|
|
4
|
+
* `internal/englishCalendarNames.ts`. Day is `1*2DIGIT` per the formal grammar, so
|
|
5
|
+
* single-digit days are valid on input even though GMT's own formatter always emits the
|
|
6
|
+
* zero-padded 2-digit form. `zone` accepts a numeric offset or one of the obsolete named
|
|
7
|
+
* zones RFC 5322 §4.3 lists (UT/GMT plus the eight North American zones); any other
|
|
8
|
+
* obs-zone letter is unrecognized and treated as invalid rather than guessed at.
|
|
9
|
+
*
|
|
10
|
+
* Capture groups: 1 day-of-week (optional, for weekday-prefixed form), 2 day, 3 month,
|
|
11
|
+
* 4 year, 5 hour, 6 minute, 7 second (optional), 8 zone.
|
|
12
|
+
*
|
|
13
|
+
* @example rfc2822DateTime.test("Wed, 09 Jun 2021 10:18:14 GMT") // true
|
|
14
|
+
* @example rfc2822DateTime.test("09 Jun 2021 10:18:14 +0000") // true (no weekday)
|
|
15
|
+
* @example rfc2822DateTime.test("9 Jun 2021 10:18:14 PST") // true (single-digit day)
|
|
16
|
+
* @example rfc2822DateTime.test("Wed, 09 Jun 2021 10:18:14 EST") // true (named zone)
|
|
17
|
+
* @example rfc2822DateTime.test("2024-03-15T14:30:00Z") // false (ISO shape)
|
|
18
|
+
*/
|
|
1
19
|
export declare const rfc2822DateTime: RegExp;
|
package/dist/regex/rfc-2822.js
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/**
|
|
2
|
+
* RegExp matching RFC 5322 §3.3 date-time grammar (obsoletes RFC 2822, same shape).
|
|
3
|
+
* English day/month names are mandated by the spec regardless of locale — see
|
|
4
|
+
* `internal/englishCalendarNames.ts`. Day is `1*2DIGIT` per the formal grammar, so
|
|
5
|
+
* single-digit days are valid on input even though GMT's own formatter always emits the
|
|
6
|
+
* zero-padded 2-digit form. `zone` accepts a numeric offset or one of the obsolete named
|
|
7
|
+
* zones RFC 5322 §4.3 lists (UT/GMT plus the eight North American zones); any other
|
|
8
|
+
* obs-zone letter is unrecognized and treated as invalid rather than guessed at.
|
|
9
|
+
*
|
|
10
|
+
* Capture groups: 1 day-of-week (optional, for weekday-prefixed form), 2 day, 3 month,
|
|
11
|
+
* 4 year, 5 hour, 6 minute, 7 second (optional), 8 zone.
|
|
12
|
+
*
|
|
13
|
+
* @example rfc2822DateTime.test("Wed, 09 Jun 2021 10:18:14 GMT") // true
|
|
14
|
+
* @example rfc2822DateTime.test("09 Jun 2021 10:18:14 +0000") // true (no weekday)
|
|
15
|
+
* @example rfc2822DateTime.test("9 Jun 2021 10:18:14 PST") // true (single-digit day)
|
|
16
|
+
* @example rfc2822DateTime.test("Wed, 09 Jun 2021 10:18:14 EST") // true (named zone)
|
|
17
|
+
* @example rfc2822DateTime.test("2024-03-15T14:30:00Z") // false (ISO shape)
|
|
18
|
+
*/
|
|
9
19
|
export const rfc2822DateTime = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun), )?(\d{1,2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{2}):(\d{2})(?::(\d{2}))? (UT|GMT|EST|EDT|CST|CDT|MST|MDT|PST|PDT|[+-]\d{4})$/;
|
package/dist/regex/rfc-3339.d.ts
CHANGED
|
@@ -1 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RegExp matching an RFC 3339 §5.6 date-time: ISO 8601 with a mandatory offset
|
|
3
|
+
* (`Z` or `±HH:MM`).
|
|
4
|
+
*
|
|
5
|
+
* - Separator may be `T`, `t`, or a space.
|
|
6
|
+
* - Offset is mandatory. GMT's own zoned strings with a bracketed IANA zone annotation
|
|
7
|
+
* (`"...+00:00[UTC]"`) do NOT match — use `calendarZonedDateTime` for those.
|
|
8
|
+
* - Shape-only validation; real calendar validation is delegated to
|
|
9
|
+
* `Temporal.Instant.from` in `parseRfc3339`.
|
|
10
|
+
* - Capture groups: 1 year, 2 month, 3 day, 4 hour, 5 minute, 6 second,
|
|
11
|
+
* 7 fractional (optional), 8 offset.
|
|
12
|
+
*
|
|
13
|
+
* @example rfc3339DateTime.test("2024-03-15T14:30:00-04:00") // true
|
|
14
|
+
* @example rfc3339DateTime.test("2024-03-15t14:30:00z") // true
|
|
15
|
+
* @example rfc3339DateTime.test("2024-03-15 14:30:00Z") // true (space separator)
|
|
16
|
+
* @example rfc3339DateTime.test("2024-03-15T14:30:00") // false (no offset)
|
|
17
|
+
* @example rfc3339DateTime.test("2024-03-15T14:30:00+00:00[UTC]") // false (bracketed zone)
|
|
18
|
+
* @example rfc3339DateTime.test("2024-3-15T14:30:00Z") // false (unpadded)
|
|
19
|
+
*/
|
|
1
20
|
export declare const rfc3339DateTime: RegExp;
|
package/dist/regex/rfc-3339.js
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* RegExp matching an RFC 3339 §5.6 date-time: ISO 8601 with a mandatory offset
|
|
3
|
+
* (`Z` or `±HH:MM`).
|
|
4
|
+
*
|
|
5
|
+
* - Separator may be `T`, `t`, or a space.
|
|
6
|
+
* - Offset is mandatory. GMT's own zoned strings with a bracketed IANA zone annotation
|
|
7
|
+
* (`"...+00:00[UTC]"`) do NOT match — use `calendarZonedDateTime` for those.
|
|
8
|
+
* - Shape-only validation; real calendar validation is delegated to
|
|
9
|
+
* `Temporal.Instant.from` in `parseRfc3339`.
|
|
10
|
+
* - Capture groups: 1 year, 2 month, 3 day, 4 hour, 5 minute, 6 second,
|
|
11
|
+
* 7 fractional (optional), 8 offset.
|
|
12
|
+
*
|
|
13
|
+
* @example rfc3339DateTime.test("2024-03-15T14:30:00-04:00") // true
|
|
14
|
+
* @example rfc3339DateTime.test("2024-03-15t14:30:00z") // true
|
|
15
|
+
* @example rfc3339DateTime.test("2024-03-15 14:30:00Z") // true (space separator)
|
|
16
|
+
* @example rfc3339DateTime.test("2024-03-15T14:30:00") // false (no offset)
|
|
17
|
+
* @example rfc3339DateTime.test("2024-03-15T14:30:00+00:00[UTC]") // false (bracketed zone)
|
|
18
|
+
* @example rfc3339DateTime.test("2024-3-15T14:30:00Z") // false (unpadded)
|
|
19
|
+
*/
|
|
7
20
|
export const rfc3339DateTime = /^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])[Tt ](0[0-9]|1[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])(\.[0-9]{1,9})?(Z|z|[+-][0-9]{2}:[0-9]{2})$/;
|
|
@@ -1 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RegExp matching an ANSI SQL / ODBC timestamp literal: `YYYY-MM-DD HH:mm[:ss[.fffffffff]]`.
|
|
3
|
+
*
|
|
4
|
+
* - Uses a space separator (never `T`), always zero-padded.
|
|
5
|
+
* - Fractional seconds use `.` only (not `,`) and support 1–9 digits.
|
|
6
|
+
* - Shape-only validation; real calendar validation is delegated to
|
|
7
|
+
* `Temporal.PlainDateTime.from` in `parseSql`.
|
|
8
|
+
*
|
|
9
|
+
* @example sqlDateTime.test("2024-03-15 14:30:00.123456789") // true
|
|
10
|
+
* @example sqlDateTime.test("2024-03-15 14:30") // true (seconds omitted)
|
|
11
|
+
* @example sqlDateTime.test("2024-03-15T14:30:00") // false (T separator)
|
|
12
|
+
* @example sqlDateTime.test("2024-3-5 14:30:00") // false (unpadded)
|
|
13
|
+
* @example sqlDateTime.test("2024-03-15 14:30:60") // false (invalid second)
|
|
14
|
+
*/
|
|
1
15
|
export declare const sqlDateTime: RegExp;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* RegExp matching an ANSI SQL / ODBC timestamp literal: `YYYY-MM-DD HH:mm[:ss[.fffffffff]]`.
|
|
3
|
+
*
|
|
4
|
+
* - Uses a space separator (never `T`), always zero-padded.
|
|
5
|
+
* - Fractional seconds use `.` only (not `,`) and support 1–9 digits.
|
|
6
|
+
* - Shape-only validation; real calendar validation is delegated to
|
|
7
|
+
* `Temporal.PlainDateTime.from` in `parseSql`.
|
|
8
|
+
*
|
|
9
|
+
* @example sqlDateTime.test("2024-03-15 14:30:00.123456789") // true
|
|
10
|
+
* @example sqlDateTime.test("2024-03-15 14:30") // true (seconds omitted)
|
|
11
|
+
* @example sqlDateTime.test("2024-03-15T14:30:00") // false (T separator)
|
|
12
|
+
* @example sqlDateTime.test("2024-3-5 14:30:00") // false (unpadded)
|
|
13
|
+
* @example sqlDateTime.test("2024-03-15 14:30:60") // false (invalid second)
|
|
14
|
+
*/
|
|
7
15
|
export const sqlDateTime = /^(?:\d{4}|[+-]\d{6})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]) (0[0-9]|1[0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?$/;
|
|
@@ -1 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RegExp matching a timezone identifier in one of three forms:
|
|
3
|
+
*
|
|
4
|
+
* 1. Literal `UTC` or `GMT`.
|
|
5
|
+
* 2. IANA-style bracketed zone: `Area/Locality` (e.g. `America/New_York`, `Asia/Tokyo`),
|
|
6
|
+
* with support for arbitrarily deep nesting (`Area/SubArea/Locality`).
|
|
7
|
+
* 3. Any other `[A-Za-z_+-]+(?:/[A-Za-z0-9_+-]+)+` shape — permissive enough to accept
|
|
8
|
+
* custom or future zone identifiers without rejecting them at the shape layer.
|
|
9
|
+
*
|
|
10
|
+
* This is a SHAPE-ONLY check used by `isValidZonedDateTime` and similar validators.
|
|
11
|
+
* Real timezone validation (existence, IANA database membership) is delegated to
|
|
12
|
+
* `Temporal.Zone.from` in `internal/calendarZonedString.ts`.
|
|
13
|
+
*
|
|
14
|
+
* @example timeZoneLike.test("UTC") // true
|
|
15
|
+
* @example timeZoneLike.test("GMT") // true
|
|
16
|
+
* @example timeZoneLike.test("America/New_York") // true
|
|
17
|
+
* @example timeZoneLike.test("Asia/Tokyo") // true
|
|
18
|
+
* @example timeZoneLike.test("Custom/Zone") // true (permissive)
|
|
19
|
+
* @example timeZoneLike.test("+05:00") // false (numeric offset, not a zone id)
|
|
20
|
+
* @example timeZoneLike.test("UTC+05:00") // false (mixed form)
|
|
21
|
+
*/
|
|
1
22
|
export declare const timeZoneLike: RegExp;
|
|
@@ -1 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RegExp matching a timezone identifier in one of three forms:
|
|
3
|
+
*
|
|
4
|
+
* 1. Literal `UTC` or `GMT`.
|
|
5
|
+
* 2. IANA-style bracketed zone: `Area/Locality` (e.g. `America/New_York`, `Asia/Tokyo`),
|
|
6
|
+
* with support for arbitrarily deep nesting (`Area/SubArea/Locality`).
|
|
7
|
+
* 3. Any other `[A-Za-z_+-]+(?:/[A-Za-z0-9_+-]+)+` shape — permissive enough to accept
|
|
8
|
+
* custom or future zone identifiers without rejecting them at the shape layer.
|
|
9
|
+
*
|
|
10
|
+
* This is a SHAPE-ONLY check used by `isValidZonedDateTime` and similar validators.
|
|
11
|
+
* Real timezone validation (existence, IANA database membership) is delegated to
|
|
12
|
+
* `Temporal.Zone.from` in `internal/calendarZonedString.ts`.
|
|
13
|
+
*
|
|
14
|
+
* @example timeZoneLike.test("UTC") // true
|
|
15
|
+
* @example timeZoneLike.test("GMT") // true
|
|
16
|
+
* @example timeZoneLike.test("America/New_York") // true
|
|
17
|
+
* @example timeZoneLike.test("Asia/Tokyo") // true
|
|
18
|
+
* @example timeZoneLike.test("Custom/Zone") // true (permissive)
|
|
19
|
+
* @example timeZoneLike.test("+05:00") // false (numeric offset, not a zone id)
|
|
20
|
+
* @example timeZoneLike.test("UTC+05:00") // false (mixed form)
|
|
21
|
+
*/
|
|
1
22
|
export const timeZoneLike = /^(?:UTC|GMT|[A-Za-z_+-]+(?:\/[A-Za-z0-9_+-]+)+)$/;
|
package/dist/regex/time.d.ts
CHANGED
|
@@ -1,6 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RegExp matching an ISO 8601 hour in extended format: `00`–`23`.
|
|
3
|
+
*
|
|
4
|
+
* @example hour.test("00") // true
|
|
5
|
+
* @example hour.test("12") // true
|
|
6
|
+
* @example hour.test("23") // true
|
|
7
|
+
* @example hour.test("24") // false (out of range)
|
|
8
|
+
* @example hour.test("9") // false (not zero-padded)
|
|
9
|
+
*/
|
|
1
10
|
export declare const hour: RegExp;
|
|
11
|
+
/**
|
|
12
|
+
* RegExp matching an ISO 8601 minute: `00`–`59`.
|
|
13
|
+
*
|
|
14
|
+
* @example minute.test("00") // true
|
|
15
|
+
* @example minute.test("30") // true
|
|
16
|
+
* @example minute.test("59") // true
|
|
17
|
+
* @example minute.test("60") // false (out of range)
|
|
18
|
+
*/
|
|
2
19
|
export declare const minute: RegExp;
|
|
20
|
+
/**
|
|
21
|
+
* RegExp matching an ISO 8601 second: `00`–`59`.
|
|
22
|
+
*
|
|
23
|
+
* @example second.test("00") // true
|
|
24
|
+
* @example second.test("30") // true
|
|
25
|
+
* @example second.test("59") // true
|
|
26
|
+
* @example second.test("60") // false (out of range; leap seconds use a different pattern)
|
|
27
|
+
*/
|
|
3
28
|
export declare const second: RegExp;
|
|
29
|
+
/**
|
|
30
|
+
* RegExp matching 1–9 fractional-second digits (nanosecond precision).
|
|
31
|
+
*
|
|
32
|
+
* - Used for the fractional portion after `.` or `,` in time strings.
|
|
33
|
+
* - Backward-compatible alias `millisecond` points to this same pattern.
|
|
34
|
+
*
|
|
35
|
+
* @example fractionalSecond.test("123") // true (milliseconds)
|
|
36
|
+
* @example fractionalSecond.test("123456789") // true (nanoseconds)
|
|
37
|
+
* @example fractionalSecond.test("0") // false (must be 1–9 digits)
|
|
38
|
+
* @example fractionalSecond.test("") // false (empty)
|
|
39
|
+
*/
|
|
4
40
|
export declare const fractionalSecond: RegExp;
|
|
41
|
+
/**
|
|
42
|
+
* Backward-compatible alias for `fractionalSecond`. Prefer `fractionalSecond` for new
|
|
43
|
+
* usage — the pattern matches 1–9 digits of fractional seconds, not just milliseconds.
|
|
44
|
+
*/
|
|
5
45
|
export declare const millisecond: RegExp;
|
|
46
|
+
/**
|
|
47
|
+
* RegExp matching ISO 8601 local time (extended): `HH:mm[:ss[.fffffffff]]`.
|
|
48
|
+
*
|
|
49
|
+
* - Hours: `00`–`23`, zero-padded.
|
|
50
|
+
* - Minutes and seconds: `00`–`59`, zero-padded.
|
|
51
|
+
* - Seconds are optional; fractional seconds use `.` or `,` followed by 1–9 digits.
|
|
52
|
+
* - No timezone designator — this is a plain/local time only.
|
|
53
|
+
* - Shape-only validation; real field validation is delegated to
|
|
54
|
+
* `Temporal.PlainTime.from` in `parseTime`.
|
|
55
|
+
*
|
|
56
|
+
* Capture groups: 1 hour, 2 minute, 3 second (optional), 4 fractional (optional).
|
|
57
|
+
*
|
|
58
|
+
* @example plainTime.test("14:30") // true
|
|
59
|
+
* @example plainTime.test("14:30:00") // true
|
|
60
|
+
* @example plainTime.test("14:30:00.123") // true (fractional seconds)
|
|
61
|
+
* @example plainTime.test("14:30:00,123") // true (comma separator)
|
|
62
|
+
* @example plainTime.test("24:00:00") // false (hour out of range)
|
|
63
|
+
* @example plainTime.test("14:30:60") // false (second out of range)
|
|
64
|
+
*/
|
|
6
65
|
export declare const plainTime: RegExp;
|