Skip to content

Editorial: Work around inconsistency in CLDR data sources#3273

Merged
Ms2ger merged 1 commit intomainfrom
3062-adjust-date-time-style-format
Feb 10, 2026
Merged

Editorial: Work around inconsistency in CLDR data sources#3273
Ms2ger merged 1 commit intomainfrom
3062-adjust-date-time-style-format

Conversation

@ptomato
Copy link
Collaborator

@ptomato ptomato commented Feb 9, 2026

See tc39/ecma402#1043. The format returned from DateTimeStyleFormat should also be able to be returned by the format matchers, but apparently because of the way the locale data in ECMA-402 is structured, which mirrors inconsistency in CLDR, this cannot be guaranteed.

Work around this inconsistency in AdjustDateTimeStyleFormat by returning the original base format if it doesn't contain any disallowed fields, so that we don't accidentally replace it with a format matcher format.

Closes: #3062

See tc39/ecma402#1043. The format returned
from DateTimeStyleFormat should also be able to be returned by the
format matchers, but apparently because of the way the locale data in
ECMA-402 is structured, which mirrors inconsistency in CLDR, this
cannot be guaranteed.

Work around this inconsistency in AdjustDateTimeStyleFormat by returning
the original base format if it doesn't contain any disallowed fields, so
that we don't accidentally replace it with a format matcher format.

Closes: #3062
@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.09%. Comparing base (65c59f1) to head (c79d3da).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3273      +/-   ##
==========================================
- Coverage   98.09%   98.09%   -0.01%     
==========================================
  Files          22       22              
  Lines       10464    10457       -7     
  Branches     1808     1808              
==========================================
- Hits        10265    10258       -7     
  Misses        182      182              
  Partials       17       17              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@justingrant justingrant left a comment

Choose a reason for hiding this comment

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

👍

@Ms2ger Ms2ger merged commit 94a7487 into main Feb 10, 2026
10 checks passed
@Ms2ger Ms2ger deleted the 3062-adjust-date-time-style-format branch February 10, 2026 12:23
ptomato added a commit that referenced this pull request Feb 10, 2026
Based on Anba's suggestion:
#3273 (comment)

We pass a List of property names into AdjustDateTimeStyleFormat instead
of a List of field names, so they can be compared directly with the
"Property" column of the "Components of date and time formats" table.
This avoids the problem of formats having other fields such as
[[pattern]] and [[pattern12]] that would always conflict with the
allowed fields.

Co-Authored-By: André Bargull <andre.bargull@gmail.com>
ptomato added a commit that referenced this pull request Feb 10, 2026
Based on Anba's suggestion:
#3273 (comment)

We pass a List of property names into AdjustDateTimeStyleFormat instead
of a List of field names, so they can be compared directly with the
"Property" column of the "Components of date and time formats" table.
This avoids the problem of formats having other fields such as
[[pattern]] and [[pattern12]] that would always conflict with the
allowed fields.

Co-Authored-By: André Bargull <andre.bargull@gmail.com>
ptomato added a commit that referenced this pull request Feb 11, 2026
Based on Anba's suggestion:
#3273 (comment)

We pass a List of property names into AdjustDateTimeStyleFormat instead
of a List of field names, so they can be compared directly with the
"Property" column of the "Components of date and time formats" table.
This avoids the problem of formats having other fields such as
[[pattern]] and [[pattern12]] that would always conflict with the
allowed fields.

Co-Authored-By: André Bargull <andre.bargull@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AdjustDateTimeStyleFormat: Don't adjust format when no conflicting options are present?

4 participants