Skip to content

Bug fix: Correctly use reference years table for chinese/dangi calendars#118

Merged
ptomato merged 2 commits intomainfrom
issue-113-NonISOMonthDayToISOReferenceDate
Feb 20, 2026
Merged

Bug fix: Correctly use reference years table for chinese/dangi calendars#118
ptomato merged 2 commits intomainfrom
issue-113-NonISOMonthDayToISOReferenceDate

Conversation

@ben-allen
Copy link
Copy Markdown
Collaborator

Bug fix:

Previously in NonISOMonthDayToISOReferenceDate when:

  • A East Asian lunisolar calendar is used, and
  • A year is given

the spec failed to indicate that the table of reference years for these calendars should be used. This oversight made the AO unimplementable. This PR corrects that.

fix #113

Copy link
Copy Markdown
Collaborator

@ptomato ptomato left a comment

Choose a reason for hiding this comment

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

Looks great. I think it makes sense to split out the *"chinese"*/*"dangi"* case in this way, and it's easy to verify that the other calendars are left unchanged.

@ptomato
Copy link
Copy Markdown
Collaborator

ptomato commented Feb 18, 2026

cc @anba @Manishearth

… the East Asian lunisolar calendars is used, and wherein a year is given. Desired behaviour is to follow the table of valid reference years in this case, which was previously overlooked.
@ptomato ptomato force-pushed the issue-113-NonISOMonthDayToISOReferenceDate branch from e94d67d to e9aae22 Compare February 20, 2026 01:12
@ptomato ptomato merged commit 2589038 into main Feb 20, 2026
@ptomato ptomato deleted the issue-113-NonISOMonthDayToISOReferenceDate branch February 20, 2026 01:18
@Manishearth
Copy link
Copy Markdown
Contributor

I believe this matches V8's behavior already because temporal_rs will first fully resolve the date and then loop back and try to get a MonthDay from it.

jessealama added a commit to jessealama/test262 that referenced this pull request Feb 25, 2026
Test the fix from tc39/proposal-intl-era-monthcode#118:
NonISOMonthDayToISOReferenceDate should always use the reference year
table for Chinese/Dangi, not the provided year.
ptomato added a commit to ptomato/proposal-intl-era-monthcode that referenced this pull request Mar 4, 2026
Makes the behaviour of the chinese/dangi clause correspond to the
non-chinese/dangi clause. This fixes an unintended regression from tc39#118.

h/t fabon-f
ptomato added a commit to ptomato/proposal-intl-era-monthcode that referenced this pull request Mar 4, 2026
Makes the behaviour of the chinese/dangi clause correspond to the
non-chinese/dangi clause. This fixes an unintended regression from tc39#118.

h/t fabon-f
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.

NonISOMonthDayToISOReferenceDate: Missing hard-coded reference years not correctly handled

3 participants