JDK-6250537 : Support long and short era names for date formatting with DateFormatSymbols
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.text
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2005-04-05
  • Updated: 2017-05-16
  • Resolved: 2017-02-08
Related Reports
Relates :  
Description
Currently, DateFormatSymbols supports only single era names. However, some other calendar systems require both regular names and abbreviations. For example, the current era in the Japanese imperial calendar system is "Heisei" which is abbreviated as "H" in short date formats.
###@###.### 2005-04-05 08:09:06 GMT

Comments
Use Calendar.getDisplayNames() method.
08-02-2017

EVALUATION Short and long era names are supported with new methods in Calendar, getDisplayName and getDisplayNames, in Mustang. But we will defer the API support in DateFormatSymbols.
03-08-2005

EVALUATION Probably it's natural to return "Heisei" (in Kanji) as default. However, the DateFormatSymbols.getEras method returns abbreviations for the Julian calendar system. We would need to ignore consistencies amoung calendar systems. The following may be the spec. Method Julian calendar Japanese calendar ----------------------------------------------------------- getEras { "BC", "AD" } { "Meiji", ..., "Heisei" } getShortEras { "BC", "AD" } { "M", ..., "H" } ###@###.### 2005-04-05 08:09:06 GMT Another option would be to use a separator in an era String, like "Heisei;H". So if SimpleDateFormat finds ";", then "H" is the abbreviation of "Heisei". ###@###.### 2005-04-05 08:16:36 GMT
05-04-2005