status = U_ILLEGAL_ARGUMENT_ERROR;
return NULL;
}
- DateFormat *result = createInstanceForSkeleton(skeleton, locale, status);
+ Locale localeWithCalendar = locale;
+ localeWithCalendar.setKeywordValue("calendar", calendar->getType(), status);
+ if (U_FAILURE(status)) {
+ return NULL;
+ }
+ DateFormat *result = createInstanceForSkeleton(skeleton, localeWithCalendar, status);
if (U_FAILURE(status)) {
return NULL;
}