JDK-8000983 : Support narrow display names for calendar fields
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.text
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2012-10-16
  • Updated: 2017-05-17
  • Resolved: 2012-12-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b69Fixed
Related Reports
Relates :  
Description
JSR 310 plans to support new date-time formatter in which narrow names can be specified as in LDML/CLDR. This support requires some API and SPI changes. The same support in java.text.SimpleDateFormat needs to be examined. Currently, 5-letter patterns specify long names.
Comments
Spec changes: - New style constants in java.util.Calendar: /** * A style specifier for {@link #getDisplayName(int, int, Locale) * getDisplayName} and {@link #getDisplayNames(int, int, Locale) * getDisplayNames} indicating a narrow name used for format. Narrow names * are typically single character strings, such as "M" for Monday. * * @see #NARROW_STANDALONE * @see #SHORT_FORMAT * @see #LONG_FOTMAT * @since 1.8 */ public static final int NARROW_FORMAT /** * A style specifier for {@link #getDisplayName(int, int, Locale) * getDisplayName} and {@link #getDisplayNames(int, int, Locale) * getDisplayNames} indicating a narrow name independently. Narrow names * are typically single character strings, such as "M" for Monday. * * @see #NARROW_FORMAT * @see #SHORT_STANDALONE * @see #LONG_STANDALONE * @since 1.8 */ public static final int NARROW_STANDALONE - java.util.Calendar.getDisplayName changes: * @param style * the style applied to the string representation; one of {@link * #SHORT_FORMAT} ({@link #SHORT}), {@link #SHORT_STANDALONE}, - * {@link #LONG_FORMAT} ({@link #LONG}) or {@link #LONG_STANDALONE}. + * {@link #LONG_FORMAT} ({@link #LONG}), {@link #LONG_STANDALONE}, + * {@link #NARROW_FORMAT}, or {@link #NARROW_STANDALONE}. - java.util.Calendar.getDisplayNames changes: + * <p>Narrow names may not be unique due to use of single characters, + * such as "S" for Sunday and Saturday. In that case narrow names are not + * included in the returned {@code Map}. * @param style * the style applied to the string representation; one of {@link * #SHORT_FORMAT} ({@link #SHORT}), {@link #SHORT_STANDALONE}, - * {@link #LONG_FORMAT} ({@link #LONG}) or {@link #LONG_STANDALONE}. + * {@link #LONG_FORMAT} ({@link #LONG}), {@link #LONG_STANDALONE}, + * {@link #NARROW_FORMAT}, or {@link #NARROW_STANDALONE} - java.util.spi.CalendarNameProvider.getDisplayName changes: * <p>{@code style} gives the style of the string representation. It is one * of {@link Calendar#SHORT_FORMAT} ({@link Calendar#SHORT SHORT}), * {@link Calendar#SHORT_STANDALONE}, {@link Calendar#LONG_FORMAT} - * ({@link Calendar#LONG LONG}), or {@link Calendar#LONG_STANDALONE}. + * ({@link Calendar#LONG LONG}), {@link Calendar#LONG_STANDALONE}, + * {@link Calendar#NARROW_FORMAT}, or {@link Calendar#NARROW_STANDALONE}. * @param style * the string representation style: one of {@link * Calendar#SHORT_FORMAT} ({@link Calendar#SHORT SHORT}), * {@link Calendar#SHORT_STANDALONE}, {@link - * Calendar#LONG_FORMAT} ({@link Calendar#LONG LONG}), or - * {@link Calendar#LONG_STANDALONE} + * Calendar#LONG_FORMAT} ({@link Calendar#LONG LONG}), + * {@link Calendar#LONG_STANDALONE}, + * {@link Calendar#NARROW_FORMAT}, + * or {@link Calendar#NARROW_STANDALONE} - java.util.spi.CalendarNameProvider.getDisplayNames changes: * <p>{@code style} gives the style of the string representation. It must be * one of {@link Calendar#ALL_STYLES}, {@link Calendar#SHORT_FORMAT} ({@link * Calendar#SHORT SHORT}), {@link Calendar#SHORT_STANDALONE}, {@link - * Calendar#LONG_FORMAT} ({@link Calendar#LONG LONG}), or {@link - * Calendar#LONG_STANDALONE}. + * Calendar#LONG_FORMAT} ({@link Calendar#LONG LONG}), {@link + * Calendar#LONG_STANDALONE}, {@link Calendar#NARROW_FORMAT}, or + * {@link Calendar#NARROW_STANDALONE}. Note that narrow names may + * not be unique due to use of single characters, such as "S" for Sunday + * and Saturday, and that no narrow names are included in that case. * @param style * the style applied to the display names; one of * {@link Calendar#ALL_STYLES}, {@link Calendar#SHORT_FORMAT} * ({@link Calendar#SHORT SHORT}), {@link * Calendar#SHORT_STANDALONE}, {@link Calendar#LONG_FORMAT} - * ({@link Calendar#LONG LONG}), or {@link - * Calendar#LONG_STANDALONE}. + * ({@link Calendar#LONG LONG}), {@link Calendar#LONG_STANDALONE}, + * {@link Calendar#NARROW_FORMAT}, + * or {@link Calendar#NARROW_STANDALONE}
03-12-2012

8000964 should be fixed before this one.
16-10-2012