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

CalendarMonthDayToISOReferenceDate: Require "eraYear + year" and "month + monthCode" to be consistent? #2864

Open
anba opened this issue May 27, 2024 · 1 comment

Comments

@anba
Copy link
Contributor

anba commented May 27, 2024

It'd be good to have more detailed information when built-in calendars need to check for consistent inputs:

// Which of these are errors?

// eraYear and year inconsistent when month is present.
Temporal.PlainMonthDay.from({calendar: "gregory", era: "ce", eraYear: 2023, year: 2022, month: 2, day: 30});

// eraYear and year inconsistent when monthCode is present.
Temporal.PlainMonthDay.from({calendar: "gregory", era: "ce", eraYear: 2023, year: 2022, monthCode: "M02", day: 30});

// month and monthCode inconsistent.
Temporal.PlainMonthDay.from({calendar: "gregory", month: 03, monthCode: "M02", day: 30});
@justingrant
Copy link
Collaborator

Meeting 2024-05-30: @gibson042 will PR a change to align behavior of non-ISO calendars to match behavior of ISO calendar, which would throw if month/monthCode or year/era/eraYear are present but inconsistent.

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

No branches or pull requests

2 participants