diff options
author | Elliott Hughes <enh@google.com> | 2012-08-06 15:40:52 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2012-09-14 20:22:17 -0700 |
commit | 08153ee01e6aa67061f628bc3fed66c6400dfd1c (patch) | |
tree | 9b929b59d92b8c339386940389987d26cbd5f9ac /core/jni | |
parent | 23321b88578a4b4438e7563ff7616b98a1c1a520 (diff) | |
download | frameworks_base-08153ee01e6aa67061f628bc3fed66c6400dfd1c.zip frameworks_base-08153ee01e6aa67061f628bc3fed66c6400dfd1c.tar.gz frameworks_base-08153ee01e6aa67061f628bc3fed66c6400dfd1c.tar.bz2 |
Switch DateUtils and Time over to using the CLDR for all week and month names.
(cherry-pick of 99c406e42ba154584070ca7ec100e8be7ff8a800.)
Conflicts:
core/res/res/values-fa/donottranslate-cldr.xml
core/res/res/values/public.xml
Bug: 6811501
Change-Id: I2ad9608ae34804e02c6b0271197e96611df12b0a
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/android_text_format_Time.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/jni/android_text_format_Time.cpp b/core/jni/android_text_format_Time.cpp index bb09421..aa2c5f39 100644 --- a/core/jni/android_text_format_Time.cpp +++ b/core/jni/android_text_format_Time.cpp @@ -239,31 +239,36 @@ static jstring android_text_format_Time_format(JNIEnv* env, jobject This, jobjectArray ja; ja = (jobjectArray) env->GetStaticObjectField(timeClass, g_shortMonthsField); for (int i = 0; i < 12; i++) { + // Calendar.JANUARY == 0. js_mon[i] = (jstring) env->NewGlobalRef(env->GetObjectArrayElement(ja, i)); locale.mon[i] = env->GetStringUTFChars(js_mon[i], NULL); } ja = (jobjectArray) env->GetStaticObjectField(timeClass, g_longMonthsField); for (int i = 0; i < 12; i++) { + // Calendar.JANUARY == 0. js_month[i] = (jstring) env->NewGlobalRef(env->GetObjectArrayElement(ja, i)); locale.month[i] = env->GetStringUTFChars(js_month[i], NULL); } ja = (jobjectArray) env->GetStaticObjectField(timeClass, g_longStandaloneMonthsField); for (int i = 0; i < 12; i++) { + // Calendar.JANUARY == 0. js_standalone_month[i] = (jstring) env->NewGlobalRef(env->GetObjectArrayElement(ja, i)); locale.standalone_month[i] = env->GetStringUTFChars(js_standalone_month[i], NULL); } ja = (jobjectArray) env->GetStaticObjectField(timeClass, g_shortWeekdaysField); for (int i = 0; i < 7; i++) { - js_wday[i] = (jstring) env->NewGlobalRef(env->GetObjectArrayElement(ja, i)); + // Calendar.SUNDAY == 1, and there's an empty string in element 0. + js_wday[i] = (jstring) env->NewGlobalRef(env->GetObjectArrayElement(ja, i + 1)); locale.wday[i] = env->GetStringUTFChars(js_wday[i], NULL); } ja = (jobjectArray) env->GetStaticObjectField(timeClass, g_longWeekdaysField); for (int i = 0; i < 7; i++) { - js_weekday[i] = (jstring) env->NewGlobalRef(env->GetObjectArrayElement(ja, i)); + // Calendar.SUNDAY == 1, and there's an empty string in element 0. + js_weekday[i] = (jstring) env->NewGlobalRef(env->GetObjectArrayElement(ja, i + 1)); locale.weekday[i] = env->GetStringUTFChars(js_weekday[i], NULL); } |