Skip to content

deps,test: restore month name in DateTimeFormat with calendar=iso8601#63223

Open
JamBalaya56562 wants to merge 1 commit intonodejs:mainfrom
JamBalaya56562:claude/fix-datetimeformat-calendar-UiiOV
Open

deps,test: restore month name in DateTimeFormat with calendar=iso8601#63223
JamBalaya56562 wants to merge 1 commit intonodejs:mainfrom
JamBalaya56562:claude/fix-datetimeformat-calendar-UiiOV

Conversation

@JamBalaya56562
Copy link
Copy Markdown

Fixes: #63041

Bug

Intl.DateTimeFormat with calendar: 'iso8601' (or with the
-u-ca-iso8601 locale extension) silently drops the month part of the
output for dateStyle 'medium'/'long'/'full' and for any explicit
month option:

new Intl.DateTimeFormat('en-US', {
  dateStyle: 'full', timeStyle: 'long',
  timeZone: 'UTC', calendar: 'iso8601',
}).format(new Date('2024-09-09T08:00:00Z'));
// before: "2024  9, Monday at 08:00:00 AM UTC"   ← month gone
// after : "2024 September 9, Monday at 08:00:00 AM UTC"

The regression was introduced in v24.13.0 with the bundled ICU update.
Per Unicode TR35 the iso8601 calendar is gregorian with ISO
week-numbering and inherits gregorian symbols, but ICU's iso8601
resource bundle is intentionally empty and does not carry month-name
symbols, so MMMM/MMM expansions resolve to empty strings during pattern
construction.

Fix

In JSDateTimeFormat::CreateDateTimeFormat, derive a copy of the ICU
locale with ca=gregory and use it for the DateTimePatternGenerator
and SimpleDateFormat construction (and the extension-fallback retry).
The iso8601 Calendar instance is still produced from the original
locale and attached via adoptCalendar, so resolvedOptions().calendar
continues to report "iso8601" and ISO week-numbering semantics are
preserved.

Reproduction

Independently reproduced against an unmodified Node v26.1.0 baseline:
https://aletheia-works.github.io/vivarium/repro/node/63041/

Tests

  • Added test/parallel/test-intl-iso8601-calendar-month.js covering
    dateStyle: 'full'/'long'/'short', explicit month: 'long', the
    explicit field skeleton path, and formatToParts month part. The
    test fails on the pre-patch tree and passes on this branch.
  • make -j test-intl passes locally on Linux/x86_64.

`Intl.DateTimeFormat` with `calendar: 'iso8601'` (or via the
`-u-ca-iso8601` locale extension) silently dropped the month part of
the formatted output for `dateStyle` `'medium'`/`'long'`/`'full'` and
for any explicit `month` option, leaving e.g.

    new Intl.DateTimeFormat('en-US', {
      dateStyle: 'full', timeStyle: 'long',
      timeZone: 'UTC', calendar: 'iso8601',
    }).format(new Date('2024-09-09T08:00:00Z'))

producing `"2024  9, Monday at 08:00:00 AM UTC"` instead of
`"2024 September 9, Monday at 08:00:00 AM UTC"`.

The ICU `iso8601` calendar resource bundle is intentionally empty: per
Unicode TR35 the iso8601 calendar is gregorian with ISO week-numbering
and therefore inherits gregorian symbols. ICU does not currently
provide month-name fallback for that calendar, so MMMM/MMM expansions
resolve to empty strings during pattern construction.

Use a copy of the ICU locale with `ca=gregory` for the pattern
generator and SimpleDateFormat construction. The iso8601 Calendar
instance is still produced from the original locale and attached via
`adoptCalendar`, so `resolvedOptions().calendar` continues to report
`"iso8601"` and ISO week-numbering semantics are preserved.

Refs: nodejs#63041

https://claude.ai/code/session_016L6yWKzfkf5JhyDzK5S6sC
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/security-wg
  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency. labels May 10, 2026
@idabeck-cpu

This comment was marked as spam.

@matisaar

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing month in Intl.DateTimeFormat output when using calendar: 'iso8601' in Node v24.13.0 and later

5 participants