Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9cd3289437d5a8281c077ddde8da7e137bd6555f
https://github.com/WebKit/WebKit/commit/9cd3289437d5a8281c077ddde8da7e137bd6555f
Author: Sosuke Suzuki <[email protected]>
Date: 2026-06-06 (Sat, 06 Jun 2026)
Changed paths:
A JSTests/stress/intl-datetimeformat-temporal-era-width.js
M Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp
Log Message:
-----------
[JSC][Temporal] `Intl.DateTimeFormat` Temporal formatters lose requested era
width
https://bugs.webkit.org/show_bug.cgi?id=316048
Reviewed by Yijia Huang.
GetDateTimeFormat copies the era option from the user's requested
skeleton into the format options by appending a single 'G' character,
regardless of the width the user requested. In UTS#35 skeletons the
field width is encoded by the character count (era: "short" = GGG,
"long" = GGGG, "narrow" = GGGGG), so era: "long" and era: "narrow"
collapse to the short form: e.g. for ko with era: "long",
Temporal.PlainDate formatted as "AD 2026년 6월 2일" while an equivalent
legacy Date formatted as "서기 2026년 6월 2일" with the same
DateTimeFormat. Copy every 'G' from the user skeleton instead so the
requested width is preserved.
This was introduced in 314541@main.
Test: JSTests/stress/intl-datetimeformat-temporal-era-width.js
* JSTests/stress/intl-datetimeformat-temporal-era-width.js: Added.
(shouldBe):
(const.locale.of.locales.const.options.of.optionsList.dtf.format):
(const.locale.of.locales.const.options.of.optionsList.dtf.formatRange):
(formatRange):
* Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::computeGetDateTimeFormat const):
Canonical link: https://commits.webkit.org/314711@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications