Open justingrant opened 1 year ago
We discussed this question at today's TG2 meeting. @FrankYFTang noted that he needed to investigate whether this change would cause problems with DateTimeFormat, but that this investigation (like all implementation concerns) was appropriate to do during Stage 3 and would not block Stage 3 advancement.
@FrankYFTang noted that he needed to investigate whether this change would cause problems with DateTimeFormat, but that this investigation (like all implementation concerns) was appropriate to do during Stage 3 and would not block Stage 3 advancement.
to be specific - My comments during the TG2 meeting is about the change to step 29.e in InitializeDateTimeFormat
This proposal recommends storing un-canonicalized Link identifiers in TimeZone and ZonedDateTime slots, and returning Link identifier strings from
ZonedDateTime.p.timeZoneId
,TimeZone.p.id
, andtoString
/toJSON
of both types.But what about
Intl.DateTimeFormat.p.resolvedOptions().timeZone
?Arguments for canonicalizing
resolvedOptions().timeZone
resolvedOptions().timeZone
users might already have production code that expects canonicalization.resolvedOptions().timeZone
is relatively undiscoverable so doesn't trigger as much user annoyance or confusion, compared with much more noticeable APIs likeZonedDateTime.p.toString()
which every developer will see in browser dev tools, debuggers, logs, etc.resolvedOptions().timeZone
provides an escape hatch in case some users really do need this capability.Arguments against canonicalizing
resolvedOptions().timeZone
resolvedOptions().timeZone
to more ergonomic/discoverable/performant Temporal APIs won't get any different behaviorTimeZone.p.canonicalize()
. But if we canonicalizeresolvedOptions().timeZone
differently from Temporal, we probably can't change this behavior later.Personally I don't have a strong opinion either way. I'm inclined to follow whatever TG2 folks think is the best way to go.