diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/ExampleGenerator.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/ExampleGenerator.java index 913e4884462..10f5a32dbfa 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/ExampleGenerator.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/ExampleGenerator.java @@ -169,6 +169,7 @@ public class ExampleGenerator { private static final Date DATE_SAMPLE2; private static final Date DATE_SAMPLE3; private static final Date DATE_SAMPLE4; + private static final Date DATE_SAMPLE5; // 15698 static { Calendar calendar = Calendar.getInstance(ZONE_SAMPLE, ULocale.ENGLISH); @@ -182,6 +183,9 @@ public class ExampleGenerator { DATE_SAMPLE3 = calendar.getTime(); calendar.set(1999, 8, 5, 23, 0, 0); // 1999-09-05 23:00:00 DATE_SAMPLE4 = calendar.getTime(); + + calendar.set(1999, 8, 5, 3, 25, 59); // 1999-09-05 03:25:59 15698 + DATE_SAMPLE5 = calendar.getTime(); // 15698 } static final List CURRENCY_SAMPLES = @@ -2513,7 +2517,7 @@ private String handleDateFormatItem(String xpath, String value, boolean showCont setBackground("'" + tlfResult + "'"), setBackground("'" + dfResult + "'") })); - examples.add(dtf.format(DATE_SAMPLE)); + examples.add(dtf.format(DATE_SAMPLE)); // 15698: "full time" -- 2 examples? // Handle date plus a single short time. dtf = @@ -2526,7 +2530,7 @@ private String handleDateFormatItem(String xpath, String value, boolean showCont setBackground("'" + tsfResult + "'"), setBackground("'" + dfResult + "'") })); - examples.add(dtf.format(DATE_SAMPLE)); + examples.add(dtf.format(DATE_SAMPLE)); // 15698: "short time" -- 2 examples? if (!formatType.contentEquals("atTime")) { // Examples for standard pattern @@ -2556,7 +2560,7 @@ private String handleDateFormatItem(String xpath, String value, boolean showCont setBackground("'" + timeRange + "'"), setBackground("'" + dfResult + "'") })); - examples.add(dtf.format(DATE_SAMPLE)); + examples.add(dtf.format(DATE_SAMPLE)); // 15698: don't need two times for range // Handle relative date plus short time range dtf = @@ -2569,7 +2573,7 @@ private String handleDateFormatItem(String xpath, String value, boolean showCont setBackground("'" + timeRange + "'"), setBackground("'" + relativeDayValue + "'") })); - examples.add(dtf.format(DATE_SAMPLE)); + examples.add(dtf.format(DATE_SAMPLE)); // 15698: don't need two times for range } } else { // Examples for atTime pattern @@ -2585,14 +2589,14 @@ private String handleDateFormatItem(String xpath, String value, boolean showCont setBackground("'" + tsfResult + "'"), setBackground("'" + relativeDayValue + "'") })); - examples.add(dtf.format(DATE_SAMPLE)); + examples.add(dtf.format(DATE_SAMPLE)); // 15698: "short time" -- 2 examples? } return formatExampleList(examples.toArray(new String[0])); } else { String id = parts.findAttributeValue("dateFormatItem", "id"); if ("NEW".equals(id) || value == null) { - return startItalicSymbol + "n/a" + endItalicSymbol; + return startItalicSymbol + "n/a" + endItalicSymbol; // 15698: doesn't seem relevant--meaning?? } else { String numbersOverride = parts.findAttributeValue("pattern", "numbers"); SimpleDateFormat sdf = @@ -2615,16 +2619,21 @@ private String handleDateFormatItem(String xpath, String value, boolean showCont return sdf.format(DATE_SAMPLE); } else { // Use contextExamples if showContexts T - String example = + String example = // 15698 clarification: what does this do, and why only do it here? showContexts ? exampleStartHeaderSymbol + contextheader + exampleEndSymbol : ""; - example = addExampleResult(sdf.format(DATE_SAMPLE), example, showContexts); - return example; + String sup_twelve_example = sdf.format(DATE_SAMPLE); // 15698 + String sub_ten_example = sdf.format(DATE_SAMPLE5); // 15698 (is it bad that these aren't chronological? idk if there's any significance to DATE_SAMPLE) + example = addExampleResult(sup_twelve_example, example, showContexts); // 15698, here the task is clear + if (!sup_twelve_example.equals(sub_ten_example)) { + example = addExampleResult(sub_ten_example, example, showContexts); // 15698 should maybe use formatExampleList, but confused about above example declaration + } + return example; // 15698 } - } else { + } else { // 15698 id contains B suggests it contains time of day, ignore? List examples = new ArrayList<>(); examples.add(sdf.format(DATE_SAMPLE3)); examples.add(sdf.format(DATE_SAMPLE));