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

Temporal: Update tests to account for use of year in ToTemporalMonthDay #4231

Conversation

gibson042
Copy link
Contributor

@gibson042 gibson042 commented Sep 18, 2024

);

const result6 = Temporal.PlainMonthDay.from({ year: 5781, month: 2, day: 30, calendar: "hebrew" }, { overflow: "constrain" });
TemporalHelpers.assertPlainMonthDay(
result6, "M02", 29,
"if monthCode is not given, year is used to determine if calendar date exists, but reference year still correct",
"year and month determine if calendar date exists, and reference year must agree (Cheshvan 5781 has 29 days)",
1972
);
Copy link

@MichaelDimmitt MichaelDimmitt Sep 19, 2024

Choose a reason for hiding this comment

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

For the Gregorian calendar and Hebrew calendar these looked good. I do not have a deep enough background on temporal to know if other calendars would be affected.

I checked a Hebrew calendar on both pr's to make sure the dates mentioned were accurate. I used this calendar to check - https://www.chabad.org/calendar/view/year.asp?tdate=1/1/2021

I am also not jewish, just trying to be a helpful force. Thanks for knocking out this work!

Screenshot 2024-09-19 at 10 55 24 AM Screenshot 2024-09-19 at 10 55 34 AM

Copy link
Contributor

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

LGTM, thanks. Note that tc39/proposal-temporal#2940 is not a normative PR - it's a clarification of the implementation-defined calendar stuff. When I originally wrote this test, I based it on a wrong interpretation of that implementation-defined stuff.

@ptomato ptomato force-pushed the temporal-gh-2940-universal-year-and-month-consistency branch from 9e34d1d to 55bc412 Compare September 19, 2024 18:23
@ptomato ptomato merged commit de3a117 into tc39:main Sep 19, 2024
8 checks passed
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.

3 participants