-
Notifications
You must be signed in to change notification settings - Fork 108
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
Make list of supported calendars #395
Comments
I think that's a good idea. |
Just for background, why supported calendars when we don't have supported locales (and we're pretty set on not adding that)? |
Good question. Locales are used only for output. Programmers should generally not use the result of For example, if a website targeting Chinese users wanted to do date math specifically in the traditional Chinese calendar, they would have to test whether their date math works in all browsers. An alternative could be for Temporal to have its own set of supported calendars, but let Intl.DateTimeFormat implement its own. However, I think this is not a good idea, because I think programmers should have the expectation that the following command always works without throwing a RangeError: Temporal.now.date().withCalendar(Intl.defaultCalendar) We can brush that issue under the rug by vague spec language that says that any calendar supported for display in Intl.DateTimeFormat must also be supported for calculations by Temporal. But then we get back to the first issue of programmers not knowing which explicit calendars are supported. |
Discussion from ECMA-402 meeting: https://github.com/tc39/ecma402/blob/master/meetings/notes-2020-01-09.md#issue-make-list-of-supported-calendars. Key points:
We therefore did not reach a conclusion. Therefore, I want to propose that we simply add the following requirement: "any calendar that is supported for formatting must also be supported for Temporal". This can be part of the Intl Temporal effort. |
I believe this is fixed: https://tc39.es/proposal-temporal/#sec-calendar-types says that Temporal should support exactly the same set of built-in calendars as ECMA-402 Intl Enumeration API gives an iterator over those calendar types. |
In Section 6 of the spec, we have well-defined rules for supported locales, currencies, and time zones, and Unified NumberFormat is adding a specific list of supported units.
I think we need to also add a list of supported calendars. We are increasingly using calendars throughout Intl APIs, and we will also be using them in Temporal.
@pipobscure
The text was updated successfully, but these errors were encountered: