ICU-6256 Fix some GMT format problems revealed by the new locale data.

X-SVN-Rev: 23914
This commit is contained in:
Yoshito Umaoka 2008-05-16 19:21:47 +00:00
parent df27373dc7
commit a416f79140
2 changed files with 5 additions and 1 deletions

View File

@ -115,7 +115,7 @@ public class TimeZoneFormatTest extends com.ibm.icu.dev.test.TestFmwk {
numDigits++;
}
}
if (numDigits >= 4) {
if (numDigits >= 3) {
// Localized GMT or RFC: total offset (raw + dst) must be preserved.
int inOffset = inOffsets[0] + inOffsets[1];
int outOffset = outOffsets[0] + outOffsets[1];

View File

@ -1252,11 +1252,15 @@ public class DateFormatSymbols implements Serializable, Cloneable {
// For now, append "ss" to the end.
if (gmtHourFormats[OFFSET_POSITIVE][OFFSET_HM].indexOf(':') != -1) {
gmtHourFormats[OFFSET_POSITIVE][OFFSET_HMS] = gmtHourFormats[OFFSET_POSITIVE][OFFSET_HM] + ":ss";
} else if (gmtHourFormats[OFFSET_POSITIVE][OFFSET_HM].indexOf('.') != -1) {
gmtHourFormats[OFFSET_POSITIVE][OFFSET_HMS] = gmtHourFormats[OFFSET_POSITIVE][OFFSET_HM] + ".ss";
} else {
gmtHourFormats[OFFSET_POSITIVE][OFFSET_HMS] = gmtHourFormats[OFFSET_POSITIVE][OFFSET_HM] + "ss";
}
if (gmtHourFormats[OFFSET_NEGATIVE][OFFSET_HM].indexOf(':') != -1) {
gmtHourFormats[OFFSET_NEGATIVE][OFFSET_HMS] = gmtHourFormats[OFFSET_NEGATIVE][OFFSET_HM] + ":ss";
} else if (gmtHourFormats[OFFSET_NEGATIVE][OFFSET_HM].indexOf('.') != -1) {
gmtHourFormats[OFFSET_NEGATIVE][OFFSET_HMS] = gmtHourFormats[OFFSET_NEGATIVE][OFFSET_HM] + ".ss";
} else {
gmtHourFormats[OFFSET_NEGATIVE][OFFSET_HMS] = gmtHourFormats[OFFSET_NEGATIVE][OFFSET_HM] + "ss";
}