-
Notifications
You must be signed in to change notification settings - Fork 149
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
ISOMonthDayFromFields ignores year when monthCode is present #2497
Comments
We may choose to change this behavior. But I think the current behavior may actually be consistent with other parts of Temporal, which also follow the following rules:
For example, the following code also doesn't throw: Temporal.PlainTime.from({hour: 12, year: 2023, month: 2, day: 29}) What makes PlainMonthDay a bit weird is that "fields that contribute to the result" can vary more than other types. If there's a We could have designed the algorithm to only require a I wouldn't object to also validating the full date whether or not |
While working on #2466, I discovered this surprising and inconsistent behavior:
Since 2023 is not a leap year, both cases should result in a RangeError.
I'm expecting to fix this along with #2466, but it still merits a distinct issue.
The text was updated successfully, but these errors were encountered: