-
Notifications
You must be signed in to change notification settings - Fork 2
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
FrankYFTang's feedback about the current spec text #39
Comments
Another non blocking review issue In
Notice recordOne and recordTwo are both result of ToTemporalTimeZoneIdentifier(one). and the return value of ToTemporalTimeZoneIdentifier based on the assertion of
has only two possibility if it is string and in your step
then we know before step 8 we must have
and therefore before step 10 it must also be
So I suggest you make the following modification
between Step 7 and 8 B. Add
after step 8
after step 9 C. Simplified step 10 to
|
To illustrate the blocking issue. Currently, on linux to run chrome for the following
If I start the chrome with "TZ="Etc/GMT+3" /opt/google/chrome/chrome" Your proposal mandate me to support if I start my chrome with which I believe that is unneeded by any real users in this world and unimplementable by what currently v8 depends on. Therefore I will block it for Stage 3. |
Yep, that's correct, and is noted in the spec: ![]() Our intent was to make it easier to understand what this proposal is changing, because most of the AOs changed by this proposal only have a one-line change. It made more sense to use Temporal's spec text as this proposal's base text, because we assumed that this proposal will not reach Stage 4 before Temporal. Making this assumption official is one of the discussion topics in our Stage 3 advancement presentation.
This was not our intent. The text in this proposal's SystemTimeZoneIdentifier is only intended to ensure that strings like "+0300" and "+03" are never returned from SystemTimeZoneIdentifier, but are instead transformed to an offset string's normalized form which is "+03:00". The goal is to ensure that implementations are free to store offset time zones as signed integers, instead of having to store the actual string that the OS gave you. This is analogous to the way this proposal requires Note that tc39/proposal-temporal@a42c2fe, which is part of tc39/proposal-temporal#2607 (the PR you requested to limit offset zone precision to minutes only) also removes the need for this proposal to change SystemTimeZoneIdentifier. The plan is for Temporal to present before this proposal at the July TC39 meeting, and if that PR is accepted then I'll remove SystemTimeZoneIdentifier changes from this proposal before presenting it to the committee. But in the meantime, I'm happy to change the SystemTimeZoneIdentifier text in this proposal to any other text that you think would best convey the normalization intent described above. Would a note suffice? If not, then I can simply remove the SystemTimeZoneIdentifier changes and assume that tc39/proposal-temporal#2607 will be accepted. Given that PR was requested from you and other implementers and it's clear that Temporal won't get to Stage 4 without it, it seems safe to assume that this PR will be accepted. Let me know which option (note or removal) you'd prefer. Note that offset time zones don't use syntax like "Etc/GMT+3:29". A valid syntax according to ECMA-262's
Assuming that tc39/proposal-temporal#2607 removes support for sub-minute units, the last two examples above will become invalid to Temporal (and to ECMA-262 after Temporal reaches Stage 4). It may make sense also file a "web reality" PR to ECMA-262 that changes ECMA-262's @gibson042's PR to add offset time zone support to ECMA-402 (tc39/ecma402#788) will also be modified to use the same limit to minutes only. I'll respond to your other feedback in a subsequent comment, but first I wanted to ensure we're working with a common understanding about the SystemTimeZoneIdentifier changes. Thanks! |
ok, you are right, I should read the grammar more carefully, it does not have the "Etc/GMT" prefix for those cases Could you explain to me why the system timezone could have any of the following?
Which OS support that? and which other program also support these TimeZone as system timezone? |
If I'm understanding your feedback correctly, then I think the current text is OK. For built-in time zones, you are correct: the result of the But for custom time zone objects, it's possible for Or were you suggesting something else that I'm not understanding? |
ok I did some more testing. It seems in MacOS the date command will respect TZ="+05:15" in that case I am convinced that we should include the support for SystemTimeZoneIdentifer for the following cases
but NOT
|
Cool, thanks for testing that. I think we're agreeing now? Assuming tc39/proposal-temporal#2607 is approved, then both Temporal and this proposal will allow Would you still prefer that I remove the changes to SystemTimeZoneIdentifier in this proposal's text? |
Assuming that is agreed, I will not block this proposal even if you keep SystemTimeZoneIdentifier as is. I can always give an implementation feedback to ask for removal if that is not pass and I will express implementation difficulty to implement that. (but I assume that will not happen) |
oh... I see. For all other Temporal.*.prototype.equals you always perform a ToTemporalXX to the other before compare. Somehow in this case we compare directly This mean if have the following code
right? |
Yep, that's how TimeZoneEquals works in current Temporal, and this proposal doesn't change it. The only difference in this proposal is that a canonicalization step is added before the final ID comparison happens. In the current Temporal spec, canonicalization happens when the TimeZone instance is constructed, but does not happen in TimeZoneEquals, so if a custom calendar's In this proposal, if a custom calendar's The code below illustrates TimeZoneEquals behavior in current Temporal vs. this proposal. const offset = '+07:00';
const epoch = new Temporal.Instant(0n);
const offsetNanoseconds = Temporal.TimeZone.from(offset).getOffsetNanosecondsFor(epoch);
const getPossibleInstantsFor = dt => dt.toZonedDateTime(offset);
const getOffsetNanosecondsFor = () => offsetNanoseconds;
timeZone1 = { id: 'Asia/Ulaanbaatar', getOffsetNanosecondsFor, getPossibleInstantsFor };
zdt1 = new Temporal.ZonedDateTime(0n, timeZone1)
// => 1970-01-01T07:00:00+07:00[Asia/Ulaanbaatar]
timeZone2 = { id: 'Asia/Ulan_Bator', getOffsetNanosecondsFor, getPossibleInstantsFor };
zdt2 = new Temporal.ZonedDateTime(0n, timeZone2);
// => 1970-01-01T07:00:00+07:00[Asia/Ulan_Bator]
timeZone3 = 'Asia/Ulan_Bator';
zdt3 = new Temporal.ZonedDateTime(0n, timeZone3);
// => 1970-01-01T07:00:00+07:00[Asia/Ulaanbaatar] (current Temporal)
// => 1970-01-01T07:00:00+07:00[Asia/Ulan_Bator] (proposal-canonical-tz)
zdt1.equals(zdt3)
// => true
zdt1.equals(zdt2)
// false (current Temporal)
// true (proposal-canonical-tz) In current Temporal, A reasonable question is whether ID comparison is the right way to determine if two time zones are equal. The short answer is that it's something we discussed a lot, and there wasn't any better way available to determine equality. So we're sticking with ID string equality as the least-bad way to determine time zone equality. |
OK great! Thanks for your support. Feel free to let me know if you see any other problems in the proposal. |
On Linux (tested on Ubuntu) it's possible to specify seconds precision: ~$ TZ="MyTimeZone+03:12:34" date "+%::z (%Z)"
-03:12:34 (MyTimeZone) But that doesn't mean I feel like we need/should support seconds precision. |
This proposal reached Stage 3 at the July 2023 TC39 meeting. As decided in the meeting, the next step is to merge this proposal into Temporal Stage 3 via tc39/proposal-temporal#2633. Thanks for the feedback, and I look forward to more feedback as this proposal is implemented. Closing this issue now. Thanks again! |
This is to reply Justin's email to me and shane after the Jun 29 2023 TG2 meeting:
Justin wrote:
Dear Justin
I have a lot of problem with your current spec text in this proposal
In all other proposal, we use
<ins>
and<del>
in the spec text to illustrate the modification from the pre-existing ECMA402 or ECMA262However, when I look at your spec text, I do not see the<ins>
and<del>
is properly inserted to show the true CHANGESIn particular the changes to InitializeDateTimeFormat
In your spec text, the only
<del>
and<ins>
for InitializeDateTimeFormat is step 29.eHowever, if we exam the current shape of InitializeDateTimeFormat in ECMA402https://tc39.es/ecma402/#sec-initializedatetimeformat
It is very different than what you proposed
In the current ECMA402, the process to resolve the TimeZone is
(see https://tc39.es/ecma402/#sec-initializedatetimeformat )
but in your spec text, it is (see https://tc39.es/proposal-canonical-tz/#sec-temporal-initializedatetimeformat )
Notice it is far more different than what you marked by
<del>
and<ins>
.I assume you are marking the
<del>
and<ins>
from the Temporal proposal instead of the ECMA262 / ECMA402since the Temporal spec text is (see https://tc39.es/proposal-temporal/#sec-temporal-initializedatetimeformat)I feel it is troublesome to advance a proposal to Stage 3 based on another unstable Stage 3 proposal (sorry to say this, but I still do not believe the Temporal proposal is stable yet by just looking at the number of lines changed in https://github.com/tc39/proposal-temporal/commits/main the last 2 months)
But let's first ignore that for a while but just look what you changed to the impact to the InitializeDateTimeFormat w/o supporting Temporal
In the current shape of ECMA402, if the timezone is undefined, the timezone is set toDefaultTimeZone().
which according to https://tc39.es/ecma402/#sup-defaulttimezone:
"6.5.3 DefaultTimeZone ( )The implementation-defined abstract operation DefaultTimeZone takes no arguments and returns a String. It returns a String value representing the host environment's current time zone, which is a valid (6.5.1) and canonicalized (6.5.2) time zone name.This definition supersedes the definition provided in es2024, 21.4.1.10."
Notice there are NO mandate for the engine to support Timezone such as "Etc/GMT+1:12:33"
Now, what Temporal proposal said about this?
The Temporal propose currently change the spec text to set to SystemTimeZoneIdentifier() and the SystemTimeZoneIdentifier is defined in https://tc39.es/proposal-temporal/#sec-systemtimezoneidentifier as
"14.9.3 SystemTimeZoneIdentifier ( )
The implementation-defined abstract operation SystemTimeZoneIdentifier takes no arguments and returns a String. It returns a String representing the host environment's current time zone, which is either a String representing a UTC offset for which IsTimeZoneOffsetString returns true, or a primary time zone identifiera primary time zone identifier or an offset time zone identifier. It performs the following steps when called:
"Notice with that definition, there are still NO mandate for the engine to support A TimeZone such as "Etc/GMT+1:12:33".
However, with the spec text in your proposal, you change the definition of SystemTimeZoneIdentifier to the following (see https://tc39.es/proposal-canonical-tz/#sec-systemtimezoneidentifier)
"
1.1 SystemTimeZoneIdentifier ( )
The implementation-defined abstract operation SystemTimeZoneIdentifier takes no arguments and returns a String. It returns a String representing the host environment's current time zone, which is either a primary time zone identifier or an offset time zone identifier.
EDITOR'S NOTE
Updates to this abstract operation overlap with a Temporal PR (#2607 - Normative: Limit offset time zones to minutes precision) being presented in the July 2023 TC39 meeting. If that PR is approved, SystemTimeZoneIdentifier changes will be removed from this proposal.
It performs the following steps when called:
"
This change the SystemTimeZoneIdentifier to support a timezone such as "Etc/GMT+1:12:33" or even
"Etc/GMT+1:12:33.123456789"
and I am strongly oppose this. I understand there is another issue to change Temporal to only accept to minutes offset, however, that part is not yet in ECMA262, ECMA402 nor Temporal proposal and it is very troublesome to advance a spec text not only depend on an unstable Stage 3 proposal but also some possible changes toward that unstable proposal.
As I mentioned, If you remove the changes to SystemTimeZoneIdentifier I am ok for that to advance to Stage 3 at this point
But based on the fact that w/ what already in ECMA262, ECMA402 and already in Temporal ONLY, your current spec text change the requirement for Intl.DateTimeFormat drmatically that we simpley cannot implement
(try to run TZ="Etc/GMT+1:12:33.123456789" chrome on Linux, it currently will have "Etc/Unknown" and I do not think it is needed to support that nor know a way to implement the support for that)
I will block this proposal to Stage 3 because of this.
The text was updated successfully, but these errors were encountered: