Skip to content

fix(core): right years and complete ranges in formatted dates; add the Pulse page (CORE-112, DOX-G9) - #523

Merged
craig-o-curtis merged 16 commits into
mainfrom
chore/522-dox-g9-track-polyfill-fix-prs
Nov 15, 2026
Merged

craig-o-curtis merged 16 commits into
mainfrom
chore/522-dox-g9-track-polyfill-fix-prs

Conversation

@craig-o-curtis

@craig-o-curtis craig-o-curtis commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Closes #522
Closes #524

Relates to #460, which waits on fullcalendar/temporal-polyfill#131 and fullcalendar/temporal-polyfill#132 before moving GMT to temporal-polyfill.

What

Two stories in one pull request.

CORE-112 (#524). Some languages' date patterns crash Node, print the wrong year, or print a range that loses part of one date. GMT no longer makes the formatToParts or formatRangeToParts call that aborts V8 on a CLDR pattern with Y. Where the engine's text differs from what the specifications give, GMT prints the specifications' text. Every repair is dormant behind its own engine probe and retires through the compat check.

Defect What goes wrong (Node 26.12.1) GMT now prints Upstream
D23 formatToParts on a pattern with Y aborts Node (exit 133) No such call is made nodejs/node#67076
D24 gd Dùbh 2025 for 2024-12-30 Dùbh 2024 CLDR-19873 (not ours; our comment adds the rest)
D25 Japanese calendar before 1873: Dec 31, 5 Meiji Dec 31, 1872 AD ICU-23341 (not ours), ICU-23619
D26 Islamic before the Hijra: -22 AH The empty value ICU-23327 (not ours)
D27 ja Japanese year: "2-digit": 令和6年 令和06年 (元年 stays) ICU-23620
D28 Chinese year: "2-digit": 05(yi-chou) 5(yi-chou) ICU-23621
D29 sw range 10 May to 12 June 2024: 10 – 12 Jun 2024 10 Mei 2024 - 12 Jun 2024 CLDR-19912, CLDR-19913, ICU-23622 to ICU-23625
D30 en-u-ca-islamic prints the astronomical date: Muh. 5, 1446 AH The tabular islamic-tbla date: Muh. 4, 1446 AH Chromium 585635918

D29 follows ECMA-402: a range is checked against the two single dates field by field, as Table 6 compares field values. Only for a pattern the engine prints wrong does GMT print the two single dates in full, joined by the language's own range separator. The probe covers 18 cases, from a dropped, repeated or misplaced field to a missing era, the ja hour 12 under hourCycle: "h12" (午前0時~3時 is now 午前12時~午前3時) and a long day period printed short.

tc39/ecma402#1116 asks ECMA-402 to limit its rule for years before 1 to calendars with an era of their own for those years.

DOX-G9 (#522). A new page, Pulse, under Start here: the ten scheduled checks GMT runs against the engines, the polyfill, the world's clocks and this site. Each shows what it watches, when it runs, its recent runs and the condition that retires it. The run history is read from GitHub at build time only, best effort. /upstream moves from Migrate to Start here beside it.

It also brings every record of our upstream filings up to date: the two fix pull requests on fullcalendar/temporal-polyfill, the Node report nodejs/node#67457, the eleven posts we corrected on 13 November, and the CLDR, ICU and Chromium reports for D29 and D30. Two probes keep GMT's own month count if a later @js-temporal/polyfill release carries tc39/proposal-temporal#3327 problem 1.

It also adds the eleven reports filed on 15 November: tc39/proposal-temporal#3337, #3338 and #3339, a comment on tc39/proposal-temporal#3301, a comment on Chromium 553245554, WebKit 331724, 331725 and 331726, ICU-23626 and ICU-23627, and nodejs/node#67484. Each row names the GMT workaround that the fix retires, or says that GMT is not affected.

Pull request Fixes What it does
fullcalendar/temporal-polyfill#131 fullcalendar/temporal-polyfill#127 Applies the ICU4X leap-year corrections to 78 Persian years from 1502 to 2987 AP
fullcalendar/temporal-polyfill#132 fullcalendar/temporal-polyfill#128 Computes the Chinese and Dangi calendars like ICU4X instead of reading Intl

Changes

CORE-112

  • packages/gmt/src/internal/weekYearGuard.ts, weekYearRange.ts, weekYearSynth.ts, weekYearText.ts, repairRangeText.ts: the D23 guard, through the formatterCache.ts construct hook, and the D24 single-date and range repairs.
  • packages/gmt/src/internal/yearPrinting.ts, yearPrintingRange.ts, japaneseNumerals.ts: D25 to D28, for single dates and ranges. formatterCache.ts exports guardedDateTimeFormat, the D23 and D24 guard without these repairs, which temporalCompat/islamicEra.ts uses.
  • packages/gmt/src/internal/rangeDetector.ts, rangeFields.ts, rangeFieldValues.ts, rangeFallback.ts, rangeRepairs.ts, rangeHooks.ts, patternKey.ts: D29. formatDateRange, formatDateTimeRange and formatZonedRange use them.
  • formatterCache.ts: D30, islamic built as islamic-tbla and islamic-rgsa as the language's default calendar.
  • temporalCompat/capabilities.ts, repros.ts and rangeFieldRepros.ts: one probe and one repro group per defect. README rows, triggers and removal steps D23 to D30. scripts/lib/workarounds.mjs: the same eight entries.
  • scripts/canary/weekYear.mjs and scripts/canary/rangeFields.mjs: the sweeps over every CLDR locale and calendar. .github/workflows/cldr-sweep-weekly.yml runs both once a week on Node 22, 24 and 26 and lists the locales that newly break or are fixed.
  • apps/dox/src/data/temporal-compat.ts and the snapshot: what breaks, D23 to D30 (33 groups, 29 still needed).
  • scripts/bundle-size.budgets.json: root to 647,000, formatDate to 175,800, chargeableDays to 216,500, operatingTimeBetween to 224,600 and dutyViolations to 249,300, for the repairs above.
  • context/domination/js-temporal-polyfill-bugs.md § AF and § AG, and issues/CORE-112.md, which holds the scope of the fix and the decisions. The spec folder is folded in and deleted.

DOX-G9

  • apps/dox/src/content/docs/pulse.mdx, src/components/pulse/, src/widgets/families/pulse/, src/lib/pulse-view.ts, pulse-mount.ts, src/data/pulse.ts: the page. scripts/lib/pulse.mjs lists the checks; apps/dox/scripts/build-pulse.mjs reads each workflow's schedule and jobs from its YAML and the run history from GitHub, and --check keeps the list and the workflows in step.
  • src/lib/section-order.ts: upstream and pulse join Start here.
  • Badges, plates and cards across the site get bevelled corners with one border width on every side. bevel-border-widths.test.ts guards that, with postcss 8.5.31 as a Dox dev dependency, the version stylelint already uses.
  • apps/dox/src/data/upstream-filings.json: every filing synced from GitHub and Jira, the two fix rows each closing its issue, and the new CLDR, ICU and Chromium reports. scripts/lib/upstream-trackers.mjs reads the Jira, Chromium and Bugzilla trackers.
  • src/data/pulse.ts and src/data/upstream-filings.ts test import.meta.env before reading their optional live files. The old test, typeof import.meta.glob, stays in the built code and is false there, so the built site never read either file. import-meta-glob-guard.test.ts bans it across src/.
  • clock-change-stored.ts: the Accepted formats disclosure on the Canada and Moroccan clock-change pages now opens. Nothing wired it before.
  • context/dox/built.md holds the page's lasting rules; the spec folder is folded in and deleted.
  • /upstream: Temporal on v26.x: until() and round() add one smallestUnit to a whole number of years, months or weeks (temporal_rs 0.2.3) nodejs/node#67457 under Native engines. "Why this polyfill" lists the Persian and Chinese/Dangi bugs in temporal-polyfill 1.0.8 with our reports and fixes.
  • context/domination/js-temporal-polyfill-bugs.md: the new filings in the Filed table, a Corrected posts table, § AD for Temporal on v26.x: until() and round() add one smallestUnit to a whole number of years, months or weeks (temporal_rs 0.2.3) nodejs/node#67457.
  • D6 workaround: two cachedDay probes (hebrew, islamic-civil) for Polyfill: non-ISO until() by months gives wrong results since #3245, and throws near the range limits tc39/proposal-temporal#3327 problem 1, which js-temporal main has since 853fc8b. 0.5.1 passes both, so no result changes.
  • context/dox/tracker.md: DOX-G9, and the issue list wraps at 100 characters.
  • scripts/lib/native-suite-tags.mjs: the native-suite rows for records S and T link WebKit 331725 and 331726, so each one goes stale when WebKit ships its fix. The temporalCompat README (D18, D19), issues/CORE-82.md and the range-edge audit no longer call those reports unfiled.

Validation

At f5209157, after merging CORE-113 (#528):

  • node scripts/affected.mjs run: all 24 checks passed, among them format, deps, test markers, licences, docs check, bundle size, the gmt, gmt-oxlint and Dox builds, stats, compat snapshot, upstream, Pulse, API surface, lint and typecheck
  • packages/gmt Vitest: 1,026 files and 76,989 tests passed
  • Dox Vitest: 597 files and 20,942 tests passed
  • /pulse/ and /upstream/ passed the Dox gates in Chromium and WebKit, dark and light: frame check, axe, tab walk, media and table fit
  • The D29 probe returns broken text for all 18 cases on Node 22.22.2 and 26.12.1, and the affected suites pass on Node 22, 24 and 26

At 59e2466f:

  • Format, test markers, docs check, Dox lint and Dox typecheck passed
  • The touched Dox suites passed, 25 files and 396 tests. The two new disclosure tests fail without the fix.
  • A Dox build shows /pulse/ with its run history: 20 passed, 3 failed and 22 with no run

At def5402c:

  • node scripts/upstream.mjs check: 53 filings and 3 listings OK
  • The upstream-filings suite passed, 49 tests
  • Format and docs check passed

…G9, #522)

Closes #522

- `upstream-filings.json`: add the fix PRs fullcalendar/temporal-polyfill#131
  (Persian, fixing fullcalendar/temporal-polyfill#127) and
  fullcalendar/temporal-polyfill#132 (Chinese and Dangi, fixing
  fullcalendar/temporal-polyfill#128). Each keeps its issue's `gmtNote`,
  since GMT runs on `@js-temporal/polyfill`.
- `context/dox/tracker.md`: add the DOX-G9 row.
@craig-o-curtis craig-o-curtis added this to the Dox milestone Nov 13, 2026
@craig-o-curtis craig-o-curtis added the documentation Improvements or additions to documentation label Nov 13, 2026

@baldurpan baldurpan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found nothing that needs changing.

What I checked

  • Both new rows match the live pull requests. fullcalendar/temporal-polyfill#131 and #132 are open, not drafts, opened 13 Nov, and close #127 and #128. Their titles and URLs match.
  • At this head, node scripts/upstream.mjs check passes with 25 filings and 3 listings OK, and node scripts/deps.mjs check passes with 59 domination, 26 dox and 5 canary rows OK.
  • The note on #131 is right. @js-temporal/polyfill 0.5.1 departs from the plain 33-year rule in exactly 78 years, 1502 to 2987 AP, and moves the leap day to the following year each time. That is the correction #127 asks for, so the fullcalendar fix can't change anything for GMT.
  • The note on #132 is right today. On 0.5.1, a Chinese or Dangi date under ICU 78 throws Unexpected leap month suffix: Mo12.
  • The tracker count adds up. The table has 26 rows on 26 issues (#475 goes with #477 and has no row of its own), and sub-stories go from 34 to 35 with the DOX-G9 row.

Two small things, no threads, take or leave them

  • context/dox/tracker.md line 6 is 105 characters. Every other line in the file wraps at 100. oxfmt skips .md, so nothing will catch it.
  • js-temporal/temporal-polyfill#360 closed on 21 Sep, and its fix (#361) is merged but not released yet. 0.5.1, from March 2025, is still the latest. When 0.5.2 ships, "throws on Chinese and Dangi dates under ICU 78" will be out of date for both this row and #128's, which has carried the same note since #469. That fix belongs to whichever pull request takes the polyfill bump, not this one.

CI is still running: Tests on Node 22, 24 and 26, and the Dox browser tests (Chromium, WebKit). The rest has passed, including the GMT TZ Tests matrix, Dox tables fit, Story consistency and No machine trailers. Release pack dry run is skipped.

baldurpan
baldurpan previously approved these changes Nov 13, 2026

@baldurpan baldurpan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at e7e1054. I opened no threads, and nothing in the diff is unread. The two points in my review are optional.

CI is still running: Tests on Node 22, 24 and 26, and the Dox browser tests (Chromium, WebKit). 46 checks have passed, including all 30 GMT TZ Tests jobs, Dox tables fit, Story consistency and No machine trailers. Release pack dry run is skipped.

…7 problem 1 (DOX-G9, #522)

- Bugs doc and swap research: list fullcalendar/temporal-polyfill#127, #128, #131 and #132, the
  status as of 13 November, and the eleven posts corrected that day. nodejs/node#67457 gets its
  own section (AD).
- /upstream: add nodejs/node#67457 under Native engines. Why this polyfill now lists the Persian
  and Chinese/Dangi bugs in temporal-polyfill 1.0.8 with our reports and fixes, and links every
  fullcalendar number.
- upstream-filings.json: synced from GitHub. The fullcalendar/temporal-polyfill#131 summary had
  the misread day the wrong way round, and the tc39/proposal-temporal#3335 summary now says the
  fake-timer case is js-temporal's. The ICU 78 note on #128 and #132 names 0.5.1, so it stays true
  after the next release.
- D6: two cachedDay probes (hebrew, islamic-civil) catch tc39/proposal-temporal#3327 problem 1,
  which js-temporal `main` has since 853fc8b. 0.5.1 passes them, so no result changes. The
  trigger, README and compat snapshot say so (13 probes, 11 failing). Patch changeset.
- The D11 trigger and nudge-window comments name 17e12be0af42, the proposal-temporal commit on
  `main`. Native-suite tags for nodejs/node#67457.
- Bundle budgets for chargeableDays, operatingTimeBetween and dutyViolations rise by 100 bytes
  for the probe rows.
- context/dox/tracker.md: wrap the issue list at 100 characters.
@craig-o-curtis craig-o-curtis changed the title docs(dox): track the two temporal-polyfill fix PRs on /upstream (DOX-G9, #522) docs(upstream): record every upstream filing, and probe for tc39/proposal-temporal#3327 problem 1 (DOX-G9, #522) Nov 13, 2026
…tted dates (CORE-112, #524)

- D23: GMT never calls formatToParts or formatRangeToParts on a pattern
  with `Y`, which aborts V8 without commit 0426b0d1045d (nodejs/node#67076).
- D24: where a CLDR pattern prints the week-of-year year, single dates
  and ranges print the calendar year, as ECMA-402 gives it.
- D25: japanese dates before 1873 print the Gregorian era.
- D26: islamic dates before the Hijra give the empty value where the
  engine prints a negative year.
- D27: ja japanese `year: 2-digit` pads the era year; 元年 stays.
- D28: chinese and dangi print the related year at full width.

Each repair is dormant behind its own engine probe and retires through
the compat check. Records tc39/ecma402#1116 and ICU-23619, ICU-23620
and ICU-23621 on the upstream page and in the bug doc.
@craig-o-curtis craig-o-curtis changed the title docs(upstream): record every upstream filing, and probe for tc39/proposal-temporal#3327 problem 1 (DOX-G9, #522) fix(core): stop the week-year crash and print the right years in dates; record every upstream filing (CORE-112, DOX-G9) Nov 14, 2026
@craig-o-curtis craig-o-curtis added the bug Something isn't working label Nov 14, 2026
…ery raw option (CORE-112, #524)

The verdict cache keyed on every option value, so values Intl ignores, such as `calendar: always`, each built a UTC twin and ran the week-year check, and thrashed the 256-entry cache. The key is now the resolved locale, calendar, numbering system and hour cycle plus the options that choose the pattern. The optionsObject formatYearMonth test drops from 6.8 s to 1.4 s on Node 22 and 26; it timed out at 30 s on the Node 22 TZ jobs.
craig-o-curtis added a commit that referenced this pull request Nov 14, 2026
## What

`apps/dox` pins `astro` 7.4.2. `pnpm audit` reports two advisories
for it, which fail CI's `No known vulnerabilities in dependencies`
step on every branch:

- GHSA-r3h5-4585-7x3w, moderate, fixed in 7.4.7
- GHSA-mh32-jxcr-mh9f, low, fixed in 7.4.5

This moves `astro` to 7.4.11, the newest release old enough for our
pnpm minimum release age. 7.4.12 would need an exclusion, and we add
none.

## Changes

- `apps/dox/package.json`: `astro` 7.4.2 to 7.4.11
- `pnpm-lock.yaml`: regenerated

## Validation

- `pnpm audit`: no known vulnerabilities
- `node scripts/deps.mjs check`: OK. `pnpm peers check`: same as main
- `dox:check`: 0 errors. `dox:lint`: clean. `dox:build`: 1,304 pages
- `dox:test`: 20,303 passed, 1 failed. The failure is not from this
  change: the test finds fullcalendar/temporal-polyfill#131 on GitHub,
  which main's filings file does not list yet. #521 and #523 both
  add it.
D23 names only V8, so the native-suite check reports it out of scope on
WebKit. The fake-browser test still expected one out-of-scope group; it
now expects two and checks D23's state like D17's.
Main added its own rows for fullcalendar/temporal-polyfill#131 and #132. Keep one row each, with main's fuller #132 summary and the #132 note that names 0.5.1.
…#522; CORE-112, #524)

Date ranges (CORE-112, D29):
- `formatDateRange`, `formatDateTimeRange` and `formatZonedRange` check the range against
  the single dates field by field, as ECMA-402 Table 6 compares field values, and fall back
  to the two single dates only for a pattern class the engine prints wrong.
- The gate covers 18 cases: a dropped, repeated or misplaced field, a missing era, the `ja`
  hour 12 under `hourCycle: h12` and the long day period printed short.
- Islamic dates before the Hijra print an empty string; `ja` keeps 元年 and pads the rest.
- A new weekly CLDR sweep runs the week-year and range-field detectors over every locale and
  calendar on Node 22, 24 and 26, and lists the locales that newly break or are fixed.
- Upstream: CLDR-19912 (comment), CLDR-19913, ICU-23622, ICU-23623, ICU-23624 and ICU-23625.
- Root bundle budget raised to 647000, and the four entry budgets that carry range
  formatting raised to match.

Pulse (DOX-G9):
- New `/pulse/` page in Start here: every scheduled check, what it watches, when it runs,
  its recent runs and the condition that retires it. The run history is read from GitHub
  at build only, best effort.
- Badges, plates and cards across the site get bevelled corners, and the /upstream rows
  are reworked.

Also refresh the compat snapshot (33 groups), the stats and the upstream filings, and add
`postcss` as a Dox dev dependency for the bevel border test.
@craig-o-curtis craig-o-curtis changed the title fix(core): stop the week-year crash and print the right years in dates; record every upstream filing (CORE-112, DOX-G9) fix(core): right years and complete ranges in formatted dates; add the Pulse page (CORE-112, DOX-G9) Nov 15, 2026
Brings in CORE-113 (#528). `plainOptionEntries` now lives in its own module on this branch, so
CORE-113's option type gate (`isIntlOptionValue`, a wrong type throws `TypeError`) moves there,
and the week-year guard's comment says so. Bundle budgets: `operatingTimeBetween` and
`dutyViolations` carry both branches' growth; `root` stays at 647000.
…last test pass

Close-out:
- Fold the CORE-112 spec into `issues/CORE-112.md` (scope of the fix and Decisions) and the
  DOX-G9 spec into `context/dox/built.md`; rewrite inbound references and delete both spec
  folders. Both trackers move to Done.
- Source comments cite CORE-112 instead of its slices.

Fixes:
- `/pulse/`: the workaround list on each card never opened, because nothing wired its
  disclosure. `mountPulse` now wires every disclosure at once, before gmt loads.
- Canada and Moroccan clock-change pages: the Accepted formats disclosure never opened either.
  `wireStoredTimes` now wires it.
- `/pulse/` and `/upstream`: the built site never read the optional live files. Vite rewrites
  `import.meta.glob` calls but leaves `typeof import.meta.glob` in the built code, where it is
  false, so every deploy showed no run history and the committed filings alone. Both modules
  now test `import.meta.env`, which Vite replaces at build, and a new guard test bans the old
  check across `src/`.
…re path

Adds the eleven reports filed today to the upstream page: tc39 #3337, #3338, #3339,
our comment on #3301, the Chromium 553245554 comment, WebKit 331724, 331725 and 331726,
ICU-23626 and ICU-23627, and nodejs/node#67484. Each row names the workaround it retires
(D15, D18, D19) or says GMT is not affected.

The native-suite tags for records S and T now point at WebKit 331725 and 331726, so
they go stale when WebKit ships the fix. The bug list, the temporalCompat README, CORE-82
and the range-edge audit no longer say those records are unfiled.
@craig-o-curtis
craig-o-curtis enabled auto-merge (squash) November 15, 2026 10:49
…k-polyfill-fix-prs

# Conflicts:
#	.github/workflows/us-clock-watch.yml

@baldurpan baldurpan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I re-read the PR from e7e1054 to def5402. This time I went line by line through the range and week-year repair files, the probes and the canary scripts. The library tests (10,859) and the Dox tests pass. node scripts/upstream.mjs check and the Pulse check are clean, and every new upstream link resolves.

I left four comments: one should-fix on cache growth in weekYearRange.ts, a D15 row that still says it isn't filed, and two small wording fixes in the docs.

Comment thread context/domination/issues/CORE-112.md Resolved
…D15 is filed

- weekYearRange: the month-day, era, reference-year and year-shift maps were keyed by the
  caller's moments and never emptied. Each now starts again at 1,024 entries, like the
  other caches in the repair files. A test shows a forgotten range is repaired the same.
- D15 is filed as tc39/proposal-temporal#3337: the temporalCompat README, zonedWallClock.ts,
  workarounds.mjs (and the compat snapshot) and CORE-83 no longer say it is unfiled.
- CORE-112: the source rule names every file `weekYearSource.test.ts` allows.
- Range-edge audit: B, C and D were filed on 2026-09-18, A on 2026-09-19.
…he stats

The cache test repaired 2,000 ranges and took 7.9 s on CI, past the 5 s limit. It now
repairs `MAX_MOMENTS / 2` ranges a week apart, each adding two new moments, which is
the fewest that empties a map (0.5 s locally), with a 15 s limit for slow runners. It
still fails with the limit removed. gmt-stats.json counts the new test.
…cache limit

The `MAX_MOMENTS` limit in `weekYearRange.ts` adds 37 bytes to the root entry
(647,037 minified against 647,000). Every other entry is within its budget.

@baldurpan baldurpan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the rest of the PR at d53df53: the scripts/upstream.mjs changes and the twelve new test files. upstream.mjs check rejected each broken fixture I tried, and the tests pass under other time zones and locales. One comment, inline.

The rule matched only dots and slashes before the module name, so an import of
`../internal/weekYearGuard` from a namespace folder passed it. It now matches any path
that ends in the module, in a static `from` or a dynamic `import(`. A stray import of
each kind from `src/plain/` fails the test.

@baldurpan baldurpan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at da1826f. All five threads are settled, and I've now read the whole PR, scripts/upstream.mjs and the new tests included. CI was still running at this head when I approved.

@craig-o-curtis
craig-o-curtis merged commit ba5fe2b into main Nov 15, 2026
51 checks passed
@craig-o-curtis
craig-o-curtis deleted the chore/522-dox-g9-track-polyfill-fix-prs branch November 15, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation gmt monorepo gmt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CORE-112 — Some languages' date patterns crash Node and print the wrong year DOX-G9 — Track the two temporal-polyfill fix PRs on /upstream

2 participants