ICU-10113 Updated DateTimePatternGeneratorSample.java. Replace gen.addPattern("d'. von' MMMM", true, returnInfo) with gen.addPattern("dd'. von' MMMM", true, returnInfo) to make the sample applicable to other locales, such as German, Simplified Chinese etc.

X-SVN-Rev: 33758
This commit is contained in:
Bing Long 2013-05-27 14:46:51 +00:00
parent 4dea9653dc
commit 32931929cb

View File

@ -124,7 +124,7 @@ public class DateTimePatternGeneratorSample {
SimpleDateFormat format = new SimpleDateFormat(gen.getBestPattern("MMMMddHmm"), locale);
DateTimePatternGenerator.PatternInfo returnInfo = new DateTimePatternGenerator.PatternInfo();
// Add '. von' to the existing pattern
gen.addPattern("d'. von' MMMM", true, returnInfo);
gen.addPattern("dd'. von' MMMM", true, returnInfo);
// Apply the new pattern
format.applyPattern(gen.getBestPattern("MMMMddHmm"));
System.out.println("New Pattern for FRENCH: "+format.toPattern());