提交 fabf4de4 编写于 作者: M mfang

8037343: Wrong dateformat for locale es_DO

Reviewed-by: okutsu
Contributed-by: me@sandipan.net
上级 e50d0d29
......@@ -75,8 +75,8 @@ public class FormatData_es_DO extends ParallelListResourceBundle {
new String[] {
"EEEE d' de 'MMMM' de 'yyyy", // full date pattern
"d' de 'MMMM' de 'yyyy", // long date pattern
"MM/dd/yyyy", // medium date pattern
"MM/dd/yy", // short date pattern
"dd/MM/yyyy", // medium date pattern
"dd/MM/yy", // short date pattern
}
},
{ "DateTimePatterns",
......
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8037343
* @summary updating dateformat for es_DO
*/
import java.text.DateFormat;
import java.util.Calendar;
import java.util.Locale;
public class Bug8037343
{
public static void main(String[] arg)
{
final Locale esDO = new Locale("es", "DO");
final String expectedShort = "31/03/12";
final String expectedMedium = "31/03/2012";
int errors = 0;
DateFormat format;
String result;
Calendar cal = Calendar.getInstance(esDO);
cal.set(Calendar.DAY_OF_MONTH, 31);
cal.set(Calendar.MONTH, Calendar.MARCH);
cal.set(Calendar.YEAR, 2012);
format = DateFormat.getDateInstance(DateFormat.SHORT, esDO);
result = format.format(cal.getTime());
if (!expectedShort.equals(result)) {
System.out.println(String.format("Short Date format for es_DO is not as expected. Expected: [%s] Actual: [%s]", expectedShort, result));
errors++;
}
format = DateFormat.getDateInstance(DateFormat.MEDIUM, esDO);
result = format.format(cal.getTime());
if (!expectedMedium.equals(result)) {
System.out.println(String.format("Medium Date format for es_DO is not as expected. Expected: [%s] Actual: [%s]", expectedMedium, result));
errors++;
}
if (errors > 0) {
throw new RuntimeException();
}
}
}
......@@ -483,8 +483,8 @@ FormatData/es_DO/TimePatterns/2=hh:mm:ss a
FormatData/es_DO/TimePatterns/3=hh:mm a
FormatData/es_DO/DatePatterns/0=EEEE d' de 'MMMM' de 'yyyy
FormatData/es_DO/DatePatterns/1=d' de 'MMMM' de 'yyyy
FormatData/es_DO/DatePatterns/2=MM/dd/yyyy
FormatData/es_DO/DatePatterns/3=MM/dd/yy
# FormatData/es_DO/DatePatterns/2=MM/dd/yyyy # Changed: see bug 8037343
# FormatData/es_DO/DatePatterns/3=MM/dd/yy # Changed: see bug 8037343
FormatData/es_DO/DateTimePatterns/0={1} {0}
FormatData/es_DO/NumberElements/0=.
FormatData/es_DO/NumberElements/1=,
......@@ -7695,3 +7695,7 @@ FormatData/es_EC/TimePatterns/0=HH:mm:ss zzzz
FormatData/es_EC/TimePatterns/1=H:mm:ss z
FormatData/es_EC/TimePatterns/2=H:mm:ss
FormatData/es_EC/TimePatterns/3=H:mm
# bug 8037343
FormatData/es_DO/DatePatterns/2=dd/MM/yyyy
FormatData/es_DO/DatePatterns/3=dd/MM/yy
......@@ -36,7 +36,7 @@
* 6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203 7101495
* 7003124 7085757 7028073 7171028 7189611 8000983 7195759 8004489 8006509
* 7114053 7074882 7040556 8013836 8021121 6192407 6931564 8027695 7090826
* 8017142
* 8017142 8037343
* @summary Verify locale data
*
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册