ecma402 icon indicating copy to clipboard operation
ecma402 copied to clipboard

ECMA-402 should allow numeric-offset host time zones

Open gibson042 opened this issue 4 years ago • 3 comments
trafficstars

Among other things, this would remove the need for ECMA-402 Temporal to override ECMA-262 DefaultTimeZone.

gibson042 avatar Nov 14 '21 21:11 gibson042

Should this be a discussion over at tc39/ecma402 instead?

ptomato avatar Nov 19 '21 19:11 ptomato

I'm considering it a change that would be part of Temporal, but if it makes more sense to discuss there then that's fine.

gibson042 avatar Nov 19 '21 21:11 gibson042

I think all the necessary changes on the Temporal side are in https://github.com/tc39/proposal-temporal/pull/2171.

In ECMA-402 they would then delete their override of DefaultTimeZone and ensure that all of its callers are prepared to deal with a numeric-offset time zone. I think that further discussion should be had over there, because it doesn't affect Temporal.

ptomato avatar May 10 '22 21:05 ptomato

Affirmed by https://github.com/tc39/ecma262/pull/2781 : https://github.com/tc39/ecma262/pull/2781#discussion_r989222467

gibson042 avatar Oct 18 '22 17:10 gibson042

For example:

new Intl.DateTimeFormat("en", { timeZone: "+01:00" })

sffc avatar Dec 08 '22 19:12 sffc

Feel free to hide this comment afterwards - I think you want timeZone: '+01:00' in the code example though?

ptomato avatar Dec 08 '22 19:12 ptomato

TG2 discussion: https://github.com/tc39/ecma402/blob/master/meetings/notes-2022-12-08.md#ecma-402-should-allow-numeric-offset-host-time-zones-683

Conclusion: Yes, move forward with a PR for this. @gibson042 kindly volunteered to make the PR.

sffc avatar Dec 08 '22 21:12 sffc

TG2 discussion: https://github.com/tc39/ecma402/blob/master/meetings/notes-2022-12-08.md#ecma-402-should-allow-numeric-offset-host-time-zones-683

Conclusion: Yes, move forward with a PR for this. @gibson042 kindly volunteered to make the PR.

@gibson042 - Is there a PR? Asking because a PR to resolve #741 may end up touching the same parts of the spec, so we should coordinate.

justingrant avatar Jan 08 '23 00:01 justingrant

Note, completing this issue should also remove the "If IsTimeZoneOffsetString(timeZone) is true, throw a RangeError exception." step from Temporal.ZonedDateTime.prototype.toLocaleString.

ptomato avatar Apr 11 '23 17:04 ptomato

Note, completing this issue should also remove the "If IsTimeZoneOffsetString(timeZone) is true, throw a RangeError exception." step from Temporal.ZonedDateTime.prototype.toLocaleString.

It's possible that future PRs (I'm working on one now!) may introduce other blocks of offset strings, so doing a full search for If IsTimeZoneOffsetString in intl.html in the Temporal spec is probably a good idea.

justingrant avatar May 12 '23 20:05 justingrant

@gibson042 - are you still on track to have a PR for this issue available for this week's TG2 meeting?

justingrant avatar May 28 '23 17:05 justingrant

pull request: #788

gibson042 avatar Jun 01 '23 15:06 gibson042

I need to investigate the cost to make the dft.resolvedOptions().timeZone return "+01:00"

FrankYFTang avatar Jun 01 '23 17:06 FrankYFTang