-
Notifications
You must be signed in to change notification settings - Fork 156
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
CalendarDateToISO: Constrain behaviour for regnal years? #2865
Comments
See also <tc39/proposal-temporal#2865> requesting for more information how this case should actually be handled.
Meeting 2024-05-30:
@gibson042 to make a PR. Because current behavior is unspecified, this will not be a normative change. |
I've just found tc39/ecma402#540 which actually wants a different behaviour for |
See also <tc39/proposal-temporal#2865> requesting for more information how this case should actually be handled.
See also <tc39/proposal-temporal#2865> requesting for more information how this case should actually be handled.
See also <tc39/proposal-temporal#2865> requesting for more information how this case should actually be handled.
@gibson042 Will you have time to work on this in the next while? If not, I can take it over. |
I think this should extend #2940, but don't plan to start it until after that lands (or is at least in a final form). |
As I went to start on this, I realized that I'm not certain where it landed. To clarify, I think there are three dimensions to consider:
tc39/ecma402#540 suggests that overflow should be irrelevant for unstable/regnal calendars (specifically, that out-of-bounds era/eraYear combinations are always mapped into the appropriate era), and presumably for stable calendars as well (in which case directionality would also become irrelevant). That makes sense to me, but it does mean that e.g. Does anyone want to argue for an approach that would sometimes throw Errors rather than remapping? |
I think you are right that remapping is the natural expected behaviour for eras. In other words, To take an example: Temporal.PlainDate.from('2019-06-01').withCalendar('japanese').subtract({ years: 1 }, { overflow: 'reject' }) I cannot imagine any possible scenario in which it would be good that this throws. Likewise, for the same example with |
PR: #2986 |
Reopening for test262 coverage. |
It'd be nice to have some more detailed information how constraining should work for regnal years in the Japanese calendar.
Whereas the spec polyfill changes to the previous era (for both
constrain
andreject
overflow behaviour):Spec polyfill has (for both
constrain
andreject
overflow behaviour):Questions I've asked myself:
constrain
overflow constrain to the start/end of the era?reject
overflow reject dates before/after the era?The text was updated successfully, but these errors were encountered: