Skip to content

Test date defaults - #5155

Open
jugglinmike wants to merge 2 commits into
tc39:mainfrom
jugglinmike:set-date-defaults
Open

jugglinmike wants to merge 2 commits into
tc39:mainfrom
jugglinmike:set-date-defaults

Conversation

@jugglinmike

Copy link
Copy Markdown
Contributor

Resolves tc39/ecma402#816

@jugglinmike
jugglinmike requested a review from a team as a code owner October 21, 2026 19:18
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

5 new or modified tests were run on 7 engines.

View workflow run

Test Engine262 GraalJS JavaScriptCore QuickJS SpiderMonkey V8 XS
intl402/DateTimeFormat/prototype/resolvedOptions/required-date-props-all-specified.js ❌ ❌ ❌ ❌ ✅ ❌ ❌
intl402/DateTimeFormat/prototype/resolvedOptions/required-date-props-none-specified.js ❌ ❌ ❌ ❌ ✅ ❌ ❌
intl402/DateTimeFormat/prototype/resolvedOptions/required-date-props-some-specified-day.js ❌ ✅ ✅ ❌ ✅ ✅ ❌
intl402/DateTimeFormat/prototype/resolvedOptions/required-date-props-some-specified-month.js ❌ ✅ ✅ ❌ ✅ ✅ ❌
intl402/DateTimeFormat/prototype/resolvedOptions/required-date-props-some-specified-year.js ❌ ✅ ❌ ❌ ✅ ❌ ❌

@sffc sffc 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.

This is a good clean test; nice work. Which engines currently pass and fail?

EDIT: I see the bot answered my question already. :)

for (const calendar of allCalendars()) {
const options = new Intl.DateTimeFormat('en', {
calendar, day: 'numeric', month: 'numeric', year: 'numeric'
}).resolvedOptions();

@sffc sffc Oct 21, 2026 •

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.

Suggestion: the main thing you're testing here (and elsewhere in this PR) is resolvedOptions behavior. The name of the PR and the test should indicate this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it. (I thought the bug was in CreateDateTimeFormat, and that we were only using resolvedOptions to observe it. If that were the case, though, then I think we'd be able to observe it through Date.prototype.toLocaleString and DateTimeFormat.prototype.formatToParts... Except we can't.)

/*---
esid: sec-intl.datetimeformat
description: Day, month, and year are honored when all three are specified
info: |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's fine to keep including the spec text blocks if you'd like, but for your reference we no longer encourage their use in new tests so you are also welcome to leave them out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Noted! In this case, I ended up adding more context because it clarifies a misunderstanding that I had in the first draft of these tests.

@jugglinmike
jugglinmike requested a review from sffc November 4, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cyclic year doesn't show up in resolvedOptions

4 participants