Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo in ToTemporalMonthDay #2457

Closed
ptomato opened this issue Jan 6, 2023 · 0 comments · Fixed by #2460
Closed

Typo in ToTemporalMonthDay #2457

ptomato opened this issue Jan 6, 2023 · 0 comments · Fixed by #2460
Assignees
Labels
normative Would be a normative change to the proposal spec-text Specification text involved
Milestone

Comments

@ptomato
Copy link
Collaborator

ptomato commented Jan 6, 2023

Spotted by @anba in #1502, split out into a separate issue.

I believe step 10 of ToTemporalMonthDay should pass result.[[Year]] as the last argument, not referenceISOYear.

Justification: assume ToTemporalMonthDay is called with the string 2023-01-05[u-ca=hebrew] which should give a PlainMonthDay of today's date in the Hebrew calendar, 12 Tevet. After step 7, we get a Record with:

  • [[Year]]: 2023
  • [[Month]]: 1
  • [[Day]]: 5
  • [[Hour]], ..., [[Nanosecond]]: all 0
  • [[TimeZone]]: { [[Z]]: false, [[OffsetString]]: undefined, [[Name]]: undefined }
  • [[Calendar]]: "hebrew"
    The early return in step 9 is skipped. Step 10 creates a PlainYearMonth with the ISO reference date of 1972-01-05, which is 18 Tevet, not 12 Tevet. This result is wrong. Instead, the reference date should be 2023-01-05, which gets passed to CalendarMonthDayFromFields in step 11 to canonicalize the reference date to 1971-12-30 (12 Tevet in the reference year.)
@ptomato ptomato added spec-text Specification text involved normative Would be a normative change to the proposal labels Jan 6, 2023
@ptomato ptomato added this to the Stage "3.5" milestone Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
normative Would be a normative change to the proposal spec-text Specification text involved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants