Skip to content

Commit b12bf30

Browse files
committed
Fix date/time style bug
1 parent 1abcef0 commit b12bf30

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

icu4c/source/i18n/messageformat2_function_registry.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,9 @@ StandardFunctions::DateTime::call(const FunctionContext& context,
809809
static DateFormat::EStyle stringToStyle(UnicodeString option, UErrorCode& errorCode) {
810810
if (U_SUCCESS(errorCode)) {
811811
UnicodeString upper = option.toUpper();
812+
if (upper.isEmpty()) {
813+
return DateFormat::EStyle::kShort;
814+
}
812815
if (upper == UnicodeString("FULL")) {
813816
return DateFormat::EStyle::kFull;
814817
}
@@ -821,7 +824,7 @@ static DateFormat::EStyle stringToStyle(UnicodeString option, UErrorCode& errorC
821824
if (upper == UnicodeString("SHORT")) {
822825
return DateFormat::EStyle::kShort;
823826
}
824-
if (upper.isEmpty() || upper == UnicodeString("DEFAULT")) {
827+
if (upper == UnicodeString("DEFAULT")) {
825828
return DateFormat::EStyle::kDefault;
826829
}
827830
errorCode = U_ILLEGAL_ARGUMENT_ERROR;

0 commit comments

Comments
 (0)