ICU-5684 Update SimpleDateFormat api doc and add test case for 'Y' and 'e'.

X-SVN-Rev: 23306
This commit is contained in:
Michael Ow 2008-01-24 21:58:44 +00:00
parent 573400e72a
commit 2701452769
2 changed files with 15 additions and 3 deletions

View File

@ -1,6 +1,6 @@
/*****************************************************************************************
* (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved
* (C) Copyright IBM Corp. 1996-2007 - All Rights Reserved
* (C) Copyright IBM Corp. 1996-2008 - All Rights Reserved
*
* The original version of this source code and documentation is copyrighted and
* owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These materials are
@ -151,6 +151,18 @@ public class IntlTestSimpleDateFormatAPI extends com.ibm.icu.dev.test.TestFmwk
if( ! s3.equals(p1) ) {
errln("ERROR: toLocalizedPattern() result did not match pattern applied");
}
// ======= Test for Ticket 5684 (Parsing patterns with 'Y' and 'e'
logln("Testing parse()");
String p2 = new String("YYYY'W'wwe");
logln("Applying pattern " + p2);
pat.applyPattern(p1);
Date dt = pat.parse("2007W014", new ParsePosition(0));
if (dt == null) {
errln("ERROR: Parsing failed using 'Y' and 'e'");
}
// ======= Test getStaticClassID()

View File

@ -78,7 +78,7 @@ import com.ibm.icu.util.ULocale;
* s second in minute (Number) 55
* S fractional second (Number) 978
* E day of week (Text) Tuesday
* e* day of week (local 1~7) (Number) 2
* e* day of week (local 1~7) (Text & Number) Tuesday & 2
* D day in year (Number) 189
* F day of week in month (Number) 2 (2nd Wed in July)
* w week in year (Number) 27
@ -1451,7 +1451,7 @@ public class SimpleDateFormat extends DateFormat {
* Format characters that indicate numeric fields. The character
* at index 0 is treated specially.
*/
private static final String NUMERIC_FORMAT_CHARS = "MyudhHmsSDFwWkK";
private static final String NUMERIC_FORMAT_CHARS = "MYyudehHmsSDFwWkK";
/**
* Return true if the given format character, occuring count