diff --git a/icu4c/source/i18n/dtptngen.cpp b/icu4c/source/i18n/dtptngen.cpp index f621fc3a1b..5ba2b5e65b 100644 --- a/icu4c/source/i18n/dtptngen.cpp +++ b/icu4c/source/i18n/dtptngen.cpp @@ -1018,8 +1018,8 @@ DateTimePatternGenerator::adjustFieldTypes(const UnicodeString& pattern, // - "field" is the field from the found pattern. // // The adjusted field should consist of characters from the originally requested - // skeleton, except in the case of UDATPG_HOUR_FIELD, in which case it should consist - // of characters from the found pattern. + // skeleton, except in the case of UDATPG_HOUR_FIELD or UDATPG_MONTH_FIELD, in + // which case it should consist of characters from the found pattern. // // The length of the adjusted field (adjFieldLen) should match that in the originally // requested skeleton, except that if there is a specified skeleton for the found pattern @@ -1041,7 +1041,7 @@ DateTimePatternGenerator::adjustFieldTypes(const UnicodeString& pattern, adjFieldLen = field.length(); } } - UChar c = (typeValue!= UDATPG_HOUR_FIELD)? reqField.charAt(0): field.charAt(0); + UChar c = (typeValue!= UDATPG_HOUR_FIELD && typeValue!= UDATPG_MONTH_FIELD)? reqField.charAt(0): field.charAt(0); field.remove(); for (int32_t i=adjFieldLen; i>0; --i) { field+=c; diff --git a/icu4c/source/test/intltest/dtifmtts.cpp b/icu4c/source/test/intltest/dtifmtts.cpp index a77cb90d36..52432f3280 100644 --- a/icu4c/source/test/intltest/dtifmtts.cpp +++ b/icu4c/source/test/intltest/dtifmtts.cpp @@ -722,7 +722,7 @@ void DateIntervalFormatTest::testFormat() { "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "M", "11", - "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMM", "11\\u6708", // (fixed expected result per ticket:6626:) + "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMM", "\\u5341\\u4E00\\u6708", // (fixed expected result per ticket:6626: and others) "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmz", "2007\\u5e7411\\u670810\\u65e5 \\u4e0a\\u534810:10 \\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0800\\u20132007\\u5e7411\\u670820\\u65e5 \\u4e0a\\u534810:10 \\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0800", diff --git a/icu4c/source/test/intltest/dtptngts.cpp b/icu4c/source/test/intltest/dtptngts.cpp index 3bbb609e02..05a168175b 100644 --- a/icu4c/source/test/intltest/dtptngts.cpp +++ b/icu4c/source/test/intltest/dtptngts.cpp @@ -122,18 +122,18 @@ void IntlTestDateTimePatternGeneratorAPI::testAPI(/*char *par*/) UnicodeString("58:59"), UnicodeString("Januar 1999"), // de 11: yyyyMMMM - UnicodeString("1.1999"), // fi: yM (fixed expected result per ticket:6626:) - UnicodeString("tammikuuta 1999"), + UnicodeString("1.1999"), // fi 0: yM (fixed expected result per ticket:6626:) + UnicodeString("tammi 1999"), // fi 1: yMMM UnicodeString("13.1.1999"), - UnicodeString("13. tammikuuta 1999"), + UnicodeString("13. tammikuuta 1999"), // fi 3: yMMMd UnicodeString("13.1."), - UnicodeString("13. tammikuuta"), + UnicodeString("13. tammikuuta"), // fi 5: MMMd UnicodeString("1. nelj. 1999"), UnicodeString("11.58 ip."), // fi 7: hhmm UnicodeString("23.58"), UnicodeString("23.58"), // fi 9: jjmm UnicodeString("58.59"), - UnicodeString("tammikuuta 1999"), // fi 11: yyyyMMMM + UnicodeString("tammikuu 1999"), // fi 11: yyyyMMMM UnicodeString("1999/1"), // ja 0: yM -> y/M CharsToUnicodeString("1999\\u5E741\\u6708"), // ja 1: yMMM -> y\u5E74M\u6708