Skip to content

Conversation

@mega123-art
Copy link
Contributor

Adds YearStyle::Always and YearStyle::Never options as per TC39 intl-eradisplay proposal.

Fixes #6010

Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

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

Always is the same as WithEra and is not needed.

Never would be a useful addition, but it seems like not a good addition to the enum which is named YearStyle, not EraDisplay as the ECMA proposal.

Also please note the "implied" style in the ECMA proposal.

@mega123-art
Copy link
Contributor Author

mega123-art commented Feb 7, 2026

Always is the same as WithEra and is not needed.

Never would be a useful addition, but it seems like not a good addition to the enum which is named YearStyle, not EraDisplay as the ECMA proposal.

Also please note the "implied" style in the ECMA proposal.

Thanks for the review! After investigating the TC39 proposal-intl-eradisplay, I found:

Current proposal status (Stage 2):

  • Only defines 3 values: "never", "always", "auto"
  • The "implied" option you mentioned doesn't exist in the current spec yet

Issues with my implementation:

  • Agree: Always is redundant with WithEra
  • Agree: Never belongs in an EraDisplay enum, not YearStyle
  • The current YearStyle mixes year precision (2-digit vs 4-digit) with era display

Proposed path forward:
Would it make more sense to:

  1. Wait for TC39 proposal to reach Stage 3+ before implementing?
  2. Create a separate EraDisplay option instead of extending YearStyle?

Should I close this PR for now? Should I update issue #6010 with these findings?

@sffc
Copy link
Member

sffc commented Feb 7, 2026

We would accept a PR adding something like YearStyle::NoEra, corresponding to the ECMA-402 proposal eraDisplay: "never".

There is discussion of eraDisplay: "implied" in the ECMA-402 proposal repository.

@mega123-art mega123-art force-pushed the feature/year-style-variants branch 2 times, most recently from 8f4875d to 464c53a Compare February 8, 2026 11:52
@mega123-art mega123-art force-pushed the feature/year-style-variants branch from 464c53a to b196039 Compare February 8, 2026 11:57
@mega123-art mega123-art requested a review from sffc February 8, 2026 12:08
@mega123-art
Copy link
Contributor Author

@sffc sir i tried to make those suggested changes

Copy link
Member

Choose a reason for hiding this comment

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

Suggestion (optional): Split this test into tests on each variant, and replace the top-level docs here with a table summarizing the results.

@mega123-art mega123-art force-pushed the feature/year-style-variants branch from e3a5287 to 5261891 Compare February 9, 2026 14:35
Co-authored-by: Shane F. Carr <shane@unicode.org>
@mega123-art mega123-art force-pushed the feature/year-style-variants branch from 5261891 to 7a5e317 Compare February 9, 2026 15:03
@mega123-art mega123-art requested a review from sffc February 9, 2026 15:09
@Manishearth Manishearth removed their request for review February 9, 2026 18:01
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.

Add additional YearStyle variants

2 participants