Skip to content

Commit 33a7366

Browse files
committed
Normative: Don't add default formatting to lone era
Previously, if `era` was given by itself in the formatting options, the default formatting for the other date/time components would be added. This is inconsistent with what we do for `dayPeriod` where a lone `dayPeriod` produces formats such as "in the afternoon". The use case of obtaining the localized era name has also been mentioned several times. This change makes a lone `era` be passed to the format matcher algorithm without added date/time components, and requires implementations to have at least a year-month-day-era and year-month-era format available (which looks to be widely available across languages in CLDR.) See: #461
1 parent 6d5ff33 commit 33a7366

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spec/datetimeformat.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ <h1>
141141
1. Else,
142142
1. Let _needDefaults_ be *true*.
143143
1. If _required_ is ~date~ or ~any~, then
144-
1. For each property name _prop_ of « *"weekday"*, *"year"*, *"month"*, *"day"* », do
144+
1. For each property name _prop_ of « *"weekday"*, *"era"*, *"year"*, *"month"*, *"day"* », do
145145
1. Let _value_ be _formatOptions_.[[&lt;_prop_&gt;]].
146146
1. If _value_ is not *undefined*, set _needDefaults_ to *false*.
147147
1. If _required_ is ~time~ or ~any~, then
@@ -261,6 +261,8 @@ <h1>Internal slots</h1>
261261
<li>weekday, year, month, day, hour, minute, second, fractionalSecondDigits</li>
262262
<li>weekday, year, month, day, hour, minute, second</li>
263263
<li>weekday, year, month, day</li>
264+
<li>era, year, month, day</li>
265+
<li>era, year, month</li>
264266
<li>year, month, day</li>
265267
<li>year, month</li>
266268
<li>month, day</li>

0 commit comments

Comments
 (0)