Add option to use variant era names #845
Labels
c: datetime
Component: dates, times, timezones
Proposal
Larger change requiring a proposal
s: blocked
Status: the issue is blocked on upstream
The
Intl.DateTimeFormat()
constructor’sera
option causes the formatted date to include the default form of an era name. CLDR allows locales to specify a “variant” form. For example, in English, the default forms are “BC” and “AD”, while the variant forms are “BCE” and “CE”. In some other languages, secular equivalents to “BCE” and “CE” are the default, while the variants are for some other synonym. The use of the non-secular forms can be awkward in some academic contexts or even offensive in some religious contexts.As far as I can tell, the Internationalization API does not provide access to these variant forms, but it would be useful as an option for some applications. For example, the OpenHistoricalMap project has been maintaining translations of “BCE” and “CE”. In order to localize date formats using
Intl.DateTimeFormat
, it’ll need to useformatToParts()
to splice out and replace the default era names with the translated variant era names: OpenHistoricalMap/issues#626 (comment).Based on CLDR’s LDML syntax, perhaps it would be reasonable to add an option alongside
era
likeeraForm
that can be set to eitherdefault
orvariant
.The text was updated successfully, but these errors were encountered: