mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-21 12:40:02 +00:00
ICU-6726 Integrate changes back into ICU4J trunk
X-SVN-Rev: 25654
This commit is contained in:
parent
b0c73cc54b
commit
f1a09911ee
3 changed files with 10 additions and 9 deletions
|
@ -222,25 +222,25 @@ public class RelativeDateFormat extends DateFormat {
|
|||
String[] patterns = calData.getDateTimePatterns();
|
||||
if (patterns != null && patterns.length >= 9) {
|
||||
int glueIndex = 8;
|
||||
if (patterns.length > 9)
|
||||
if ((patterns.length > 9) && (patterns.length >= 13))
|
||||
{
|
||||
switch (fDateStyle)
|
||||
{
|
||||
case DateFormat.RELATIVE_FULL:
|
||||
case DateFormat.FULL:
|
||||
//glueIndex += DateFormat.FULL;
|
||||
glueIndex += (DateFormat.FULL + 1);
|
||||
break;
|
||||
case DateFormat.RELATIVE_LONG:
|
||||
case DateFormat.LONG:
|
||||
glueIndex += DateFormat.LONG;
|
||||
glueIndex += (DateFormat.LONG +1);
|
||||
break;
|
||||
case DateFormat.RELATIVE_MEDIUM:
|
||||
case DateFormat.MEDIUM:
|
||||
glueIndex += DateFormat.MEDIUM;
|
||||
glueIndex += (DateFormat.MEDIUM +1);
|
||||
break;
|
||||
case DateFormat.RELATIVE_SHORT:
|
||||
case DateFormat.SHORT:
|
||||
glueIndex += DateFormat.SHORT;
|
||||
glueIndex += (DateFormat.SHORT + 1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -541,9 +541,9 @@ public class SimpleDateFormat extends DateFormat {
|
|||
CalendarData calData = new CalendarData(cachedDefaultLocale, cal.getType());
|
||||
String[] dateTimePatterns = calData.getDateTimePatterns();
|
||||
int glueIndex = 8;
|
||||
if (dateTimePatterns.length > 9)
|
||||
if ((dateTimePatterns.length > 9) && (dateTimePatterns.length >= 13))
|
||||
{
|
||||
glueIndex += SHORT;
|
||||
glueIndex += (SHORT + 1);
|
||||
}
|
||||
cachedDefaultPattern = MessageFormat.format(dateTimePatterns[glueIndex],
|
||||
new Object[] {dateTimePatterns[SHORT], dateTimePatterns[SHORT + 4]});
|
||||
|
|
|
@ -3185,6 +3185,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable {
|
|||
"{1} {0}",
|
||||
"{1} {0}",
|
||||
"{1} {0}",
|
||||
"{1} {0}",
|
||||
"{1} {0}"
|
||||
};
|
||||
|
||||
|
@ -3210,9 +3211,9 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable {
|
|||
String pattern = null;
|
||||
if ((timeStyle >= 0) && (dateStyle >= 0)) {
|
||||
int glueIndex = 8;
|
||||
if (patterns.length > 9)
|
||||
if ((patterns.length > 9) && (patterns.length >= 13))
|
||||
{
|
||||
glueIndex += dateStyle;
|
||||
glueIndex += (dateStyle + 1);
|
||||
}
|
||||
pattern = MessageFormat.format(patterns[glueIndex],
|
||||
new Object[] {patterns[timeStyle], patterns[dateStyle + 4]});
|
||||
|
|
Loading…
Add table
Reference in a new issue