Update of Extend TimeZoneName Option Proposal in Stage 3
Frank Yung-Fong Tang / 譚永鋒
TC39 July 2021 Meeting
July 13-17, 2021
Slide: https://docs.google.com/presentation/d/1a4cp-Jw_k47iv3oHFDC2rhkNPHbZbTzrZOSVR_4_QlM �Repo: https://github.com/tc39/proposal-intl-extend-timezonename/
Motivation / Scope
Extend the timeZoneName option in Intl.DateTimeFormat object to support more formatted options.
History
Sample Usage in English Locale
d8> let timeZoneNames = ["short", "long", "shortOffset", "longOffset", "shortGeneric", "longGeneric"];
d8> timeZoneNames.forEach(function(timeZoneName) { print((new Date()).toLocaleTimeString("en", {timeZoneName}))});
9:27:14 AM PST
9:27:14 AM Pacific Standard Time
9:27:14 AM GMT-8
9:27:14 AM GMT-08:00
9:27:14 AM PT
9:27:14 AM Pacific Time
Sample Usage in Traditional Chinese Locale (zh-CN)
d8> let timeZoneNames = ["short", "long", "shortOffset", "longOffset", "shortGeneric", "longGeneric"];
d8> timeZoneNames.forEach(function(timeZoneName) { print((new Date()).toLocaleTimeString("zh-Hant", {timeZoneName}))});
上午9:27:27 [PST]
上午9:27:27 [太平洋標準時間]
上午9:27:27 [GMT-8]
上午9:27:27 [GMT-08:00]
上午9:27:27 [PT]
上午9:27:27 [太平洋時間]
Acknowledgement
I would like to thank the following delegates for supporting the development & deployment of this proposal
Also special thanks to André Bargul @anba from Mozilla for his amazing review.
Stage 3 Activities
Requesting the Committee
to help the development of test262, MDN, polyfills and to evangelize this new API