-
Notifications
You must be signed in to change notification settings - Fork 12
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
Possible forward-compatibility issue in Intl.Locale.prototype.getTimeZones()? #73
Comments
I think such concern is already in the Status Quo with the singular .timeZone, right? Assuming we do not have this proposal, we also need to address the issue for .timeZone (singular) which is pre-exist in ECMA402. I think the same resolution could just be applied to .timeZones . |
There's no singular |
good point. I got confused. |
I am not sure what would be a good action item for this issue |
I think if I were in your shoes, I'd simply present this issue at the next ECMA-402 meeting, so more folks can chime in. The two most likely outcomes are:
I don't even know if anyone actually has any opinion on this particular issue. |
This issue was filed under many assumptions which is hard to discuss before resolving them first. The core issues based on
which is really a totally different name space Therefore, I transfer this issue to ECMA402 for the consideration and leave this issue for whoever champion to add the support to read "tz" extension in Unicode Locale identifier to solve. I think likely that will be stored in a different internal slot and access via a different name if that will ever happen. |
I wasn't aware of this issue. I agree it would be nice to not take the name I suggest one of the following:
I suggest (1) to unblock the Intl Locale Info proposal. CC @justingrant |
I agree with Shane's proposal to use |
It return an Array - which is an object, therefore, it cannot be a getter. but a function. We have discussed this early this year. It must be a getXXX function. I do not think we should go back to rediscuss this again.
I think that should be done in a proposal which allow the Intl.DateTimeFormat to take Temporal.TimeZone as parameter for the timeZone option bag instead of in the Intl Locale Info API proposal. |
Also in https://www.unicode.org/reports/tr35/#UnicodeTimezoneIdentifier the issue @anba referring to is the "Short identifiers", Not "Time Zone Identifier" "The short identifiers are defined in the file common/bcp47/timezone.xml." |
But Intl.DateTimeFormat constructor and Intl.DateTimeFormat.prototype.resolvedOptons() ALREADY take the name "timeZone" YEARS ago. |
This is not true. Not the SAME name. The name for BCP-47 tz name is "Short Identifier" not "Time Zone Identifier", as mentioned in the UTS 35. |
+1 on I think the precedent of the Intl.DateTimeFormat field called |
@anba what is your view about changing it to getTimeZoneIds() since you are the one who filed this issue. |
I am not quite sure how would renaming this to getTimeZoneIds() will address the forward-compatibility issue @anba is filing about. then |
For both this issue and #70, I am comfortable with ECMA-402 objects supporting multiple namespaces (Unicode vs. IANA here, Unicode vs. ISO 8601 in #70), provided that each is associated with a distinct property name and (for input) inconsistency and possibly also non-inconsistent redundancy is rejected. For example,
|
Yeah, I'm convinced that if/when we add support for Unicode-style time zone IDs, we should give them a very clearly unique namespace, such as |
Agree, separate names seems like the way to go. |
OK, we have several options to resolve this issue
Option A- Keep the prospoal as is, getTimeZones() return an array (therefore it is an object) which contains Strings As a stage 3 proposal. My understanding is according to https://tc39.es/process-document/ Therefore, unless we have a implementer find a critical issue based on " implementation experience" we should not make such change. Is there a case showing us that is the case now? As v8 implementer, I do NOT feel it is a "critical based on implementation experience" to rename it. It will be nice if we have implementater for other engines or library to speak about their " implementation experience". |
I'll note that this issue was opened by @anba (an implementer). There is also new information since this reached Stage 3, which is that Temporal only recently decided to go with I think the only real options are
|
The point @anba made while filing this bug is not about getTimeZones vs getTimeZoneIds but how to deal with "tz" Unicode extension in the future and that issue exist regardless how we name this function between getTimeZones and getTimeZoneIds, right? |
I think there's probably room for |
Changing The following advantages for
But these points all also apply to |
We discussed this in 2023-09-07 TG2, and attendees supprt keeping the current spec text with getTimeZones() and getCalendars() without changing it to Ids() suffix. |
get Intl.Locale.prototype.timeZones
is spec'ed to return IANA names, so if we ever extendIntl.Locale
to support the "tz" Unicode extension, I have to assume thatget Intl.Locale.prototype.timeZone
will also return the resolved IANA name instead of the "tz" value. For examplenew Intl.Locale("en-u-tz-usnyc").timeZones
will then return["America/New_York"]
. And following that line of thought, I assumenew Intl.Locale("en-u-tz-usnyc").timeZone
(so singular "timeZone") will then also return"America/New_York"
, to keep things consistent.Do we expect that this will cause any issues for users who want to access the actual value "usnyc"?
The text was updated successfully, but these errors were encountered: