Java Code Examples for java.time.format.TextStyle#SHORT

The following examples show how to use java.time.format.TextStyle#SHORT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestZoneTextPrinterParser.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="preferredZones")
    Object[][] data_preferredZones() {
        return new Object[][] {
            {"America/New_York", "Eastern Standard Time", none,      Locale.ENGLISH, TextStyle.FULL},
//          {"EST",              "Eastern Standard Time", preferred, Locale.ENGLISH, TextStyle.FULL},
            {"Europe/Paris",     "Central European Time", none,      Locale.ENGLISH, TextStyle.FULL},
            {"CET",              "Central European Time", preferred, Locale.ENGLISH, TextStyle.FULL},
            {"Asia/Shanghai",    "China Standard Time",   none,      Locale.ENGLISH, TextStyle.FULL},
            {"Asia/Taipei",      "China Standard Time",   preferred, Locale.ENGLISH, TextStyle.FULL},
            {"America/Chicago",  "CST",                   none,      Locale.ENGLISH, TextStyle.SHORT},
            {"Asia/Taipei",      "CST",                   preferred, Locale.ENGLISH, TextStyle.SHORT},
            {"Australia/South",  "ACST",                  preferred_s, Locale.ENGLISH, TextStyle.SHORT},
            {"America/Chicago",  "CDT",                   none,        Locale.ENGLISH, TextStyle.SHORT},
            {"Asia/Shanghai",    "CDT",                   preferred_s, Locale.ENGLISH, TextStyle.SHORT},
       };
    }
 
Example 2
Source File: TestZoneTextPrinterParser.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="preferredZones")
    Object[][] data_preferredZones() {
        return new Object[][] {
            {"America/New_York", "Eastern Standard Time", none,      Locale.ENGLISH, TextStyle.FULL},
//          {"EST",              "Eastern Standard Time", preferred, Locale.ENGLISH, TextStyle.FULL},
            {"Europe/Paris",     "Central European Time", none,      Locale.ENGLISH, TextStyle.FULL},
            {"CET",              "Central European Time", preferred, Locale.ENGLISH, TextStyle.FULL},
            {"Asia/Shanghai",    "China Standard Time",   none,      Locale.ENGLISH, TextStyle.FULL},
            {"Asia/Taipei",      "China Standard Time",   preferred, Locale.ENGLISH, TextStyle.FULL},
            {"America/Chicago",  "CST",                   none,      Locale.ENGLISH, TextStyle.SHORT},
            {"Asia/Taipei",      "CST",                   preferred, Locale.ENGLISH, TextStyle.SHORT},
            {"Australia/South",  "ACST",                  preferred_s, Locale.ENGLISH, TextStyle.SHORT},
            {"America/Chicago",  "CDT",                   none,        Locale.ENGLISH, TextStyle.SHORT},
            {"Asia/Shanghai",    "CDT",                   preferred_s, Locale.ENGLISH, TextStyle.SHORT},
       };
    }
 
Example 3
Source File: TestZoneTextPrinterParser.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="preferredZones")
    Object[][] data_preferredZones() {
        return new Object[][] {
            {"America/New_York", "Eastern Standard Time", none,      Locale.ENGLISH, TextStyle.FULL},
//          {"EST",              "Eastern Standard Time", preferred, Locale.ENGLISH, TextStyle.FULL},
            {"Europe/Paris",     "Central European Time", none,      Locale.ENGLISH, TextStyle.FULL},
            {"CET",              "Central European Time", preferred, Locale.ENGLISH, TextStyle.FULL},
            {"Asia/Shanghai",    "China Standard Time",   none,      Locale.ENGLISH, TextStyle.FULL},
            {"Asia/Taipei",      "China Standard Time",   preferred, Locale.ENGLISH, TextStyle.FULL},
            {"America/Chicago",  "CST",                   none,      Locale.ENGLISH, TextStyle.SHORT},
            {"Asia/Taipei",      "CST",                   preferred, Locale.ENGLISH, TextStyle.SHORT},
            {"Australia/South",  "ACST",                  preferred_s, Locale.ENGLISH, TextStyle.SHORT},
            {"America/Chicago",  "CDT",                   none,        Locale.ENGLISH, TextStyle.SHORT},
            {"Asia/Shanghai",    "CDT",                   preferred_s, Locale.ENGLISH, TextStyle.SHORT},
       };
    }
 
Example 4
Source File: TestZoneTextPrinterParser.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="preferredZones")
    Object[][] data_preferredZones() {
        return new Object[][] {
            {"America/New_York", "Eastern Standard Time", none,      Locale.ENGLISH, TextStyle.FULL},
//          {"EST",              "Eastern Standard Time", preferred, Locale.ENGLISH, TextStyle.FULL},
            {"Europe/Paris",     "Central European Time", none,      Locale.ENGLISH, TextStyle.FULL},
            {"CET",              "Central European Time", preferred, Locale.ENGLISH, TextStyle.FULL},
            {"Asia/Shanghai",    "China Standard Time",   none,      Locale.ENGLISH, TextStyle.FULL},
            {"Asia/Taipei",      "China Standard Time",   preferred, Locale.ENGLISH, TextStyle.FULL},
            {"America/Chicago",  "CST",                   none,      Locale.ENGLISH, TextStyle.SHORT},
            {"Asia/Taipei",      "CST",                   preferred, Locale.ENGLISH, TextStyle.SHORT},
            {"Australia/South",  "CST",                   preferred_s, Locale.ENGLISH, TextStyle.SHORT},
            {"America/Chicago",  "CDT",                   none,        Locale.ENGLISH, TextStyle.SHORT},
            {"Asia/Shanghai",    "CDT",                   preferred_s, Locale.ENGLISH, TextStyle.SHORT},
       };
    }
 
Example 5
Source File: TCKOffsetPrinterParser.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="print_localized")
public void test_print_localized(TextStyle style, LocalDateTime ldt, ZoneOffset offset, String expected) {
    OffsetDateTime odt = OffsetDateTime.of(ldt, offset);
    ZonedDateTime zdt = ldt.atZone(offset);

    DateTimeFormatter f = new DateTimeFormatterBuilder().appendLocalizedOffset(style)
                                                        .toFormatter();
    assertEquals(f.format(odt), expected);
    assertEquals(f.format(zdt), expected);
    assertEquals(f.parse(expected, ZoneOffset::from), offset);

    if (style == TextStyle.FULL) {
        f = new DateTimeFormatterBuilder().appendPattern("ZZZZ")
                                          .toFormatter();
        assertEquals(f.format(odt), expected);
        assertEquals(f.format(zdt), expected);
        assertEquals(f.parse(expected, ZoneOffset::from), offset);

        f = new DateTimeFormatterBuilder().appendPattern("OOOO")
                                          .toFormatter();
        assertEquals(f.format(odt), expected);
        assertEquals(f.format(zdt), expected);
        assertEquals(f.parse(expected, ZoneOffset::from), offset);
    }

    if (style == TextStyle.SHORT) {
        f = new DateTimeFormatterBuilder().appendPattern("O")
                                          .toFormatter();
        assertEquals(f.format(odt), expected);
        assertEquals(f.format(zdt), expected);
        assertEquals(f.parse(expected, ZoneOffset::from), offset);
    }
}
 
Example 6
Source File: TestTextParser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="parseNumber")
Object[][] provider_number() {
    return new Object[][] {
        {DAY_OF_MONTH, TextStyle.FULL, 1, "1"},
        {DAY_OF_MONTH, TextStyle.FULL, 2, "2"},
        {DAY_OF_MONTH, TextStyle.FULL, 30, "30"},
        {DAY_OF_MONTH, TextStyle.FULL, 31, "31"},

        {DAY_OF_MONTH, TextStyle.SHORT, 1, "1"},
        {DAY_OF_MONTH, TextStyle.SHORT, 2, "2"},
        {DAY_OF_MONTH, TextStyle.SHORT, 30, "30"},
        {DAY_OF_MONTH, TextStyle.SHORT, 31, "31"},
   };
}
 
Example 7
Source File: TCKOffsetPrinterParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="print_localized")
public void test_print_localized(TextStyle style, LocalDateTime ldt, ZoneOffset offset, String expected) {
    OffsetDateTime odt = OffsetDateTime.of(ldt, offset);
    ZonedDateTime zdt = ldt.atZone(offset);

    DateTimeFormatter f = new DateTimeFormatterBuilder().appendLocalizedOffset(style)
                                                        .toFormatter();
    assertEquals(f.format(odt), expected);
    assertEquals(f.format(zdt), expected);
    assertEquals(f.parse(expected, ZoneOffset::from), offset);

    if (style == TextStyle.FULL) {
        f = new DateTimeFormatterBuilder().appendPattern("ZZZZ")
                                          .toFormatter();
        assertEquals(f.format(odt), expected);
        assertEquals(f.format(zdt), expected);
        assertEquals(f.parse(expected, ZoneOffset::from), offset);

        f = new DateTimeFormatterBuilder().appendPattern("OOOO")
                                          .toFormatter();
        assertEquals(f.format(odt), expected);
        assertEquals(f.format(zdt), expected);
        assertEquals(f.parse(expected, ZoneOffset::from), offset);
    }

    if (style == TextStyle.SHORT) {
        f = new DateTimeFormatterBuilder().appendPattern("O")
                                          .toFormatter();
        assertEquals(f.format(odt), expected);
        assertEquals(f.format(zdt), expected);
        assertEquals(f.parse(expected, ZoneOffset::from), offset);
    }
}
 
Example 8
Source File: TCKOffsetPrinterParser.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="print_localized")
Object[][] data_print_localized() {
    return new Object[][] {
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_UTC, "GMT"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_P0100, "GMT+01:00"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_P0123, "GMT+01:23"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_P0023, "GMT+00:23"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_P012345, "GMT+01:23:45"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M000045, "GMT-00:00:45"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M0100, "GMT-01:00"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M0123, "GMT-01:23"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M0023, "GMT-00:23"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M012345, "GMT-01:23:45"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M000045, "GMT-00:00:45"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_UTC, "GMT"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_P0100, "GMT+1"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_P0123, "GMT+1:23"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_P0023, "GMT+0:23"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_P012345, "GMT+1:23:45"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M000045, "GMT-0:00:45"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M0100, "GMT-1"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M0123, "GMT-1:23"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M0023, "GMT-0:23"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M012345, "GMT-1:23:45"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M000045, "GMT-0:00:45"},
    };
}
 
Example 9
Source File: TestTextParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="parseNumber")
Object[][] provider_number() {
    return new Object[][] {
        {DAY_OF_MONTH, TextStyle.FULL, 1, "1"},
        {DAY_OF_MONTH, TextStyle.FULL, 2, "2"},
        {DAY_OF_MONTH, TextStyle.FULL, 30, "30"},
        {DAY_OF_MONTH, TextStyle.FULL, 31, "31"},

        {DAY_OF_MONTH, TextStyle.SHORT, 1, "1"},
        {DAY_OF_MONTH, TextStyle.SHORT, 2, "2"},
        {DAY_OF_MONTH, TextStyle.SHORT, 30, "30"},
        {DAY_OF_MONTH, TextStyle.SHORT, 31, "31"},
   };
}
 
Example 10
Source File: TCKOffsetPrinterParser.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="print_localized")
Object[][] data_print_localized() {
    return new Object[][] {
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_UTC, "GMT"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_P0100, "GMT+01:00"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_P0123, "GMT+01:23"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_P0023, "GMT+00:23"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_P012345, "GMT+01:23:45"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M000045, "GMT-00:00:45"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M0100, "GMT-01:00"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M0123, "GMT-01:23"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M0023, "GMT-00:23"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M012345, "GMT-01:23:45"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M000045, "GMT-00:00:45"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_UTC, "GMT"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_P0100, "GMT+1"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_P0123, "GMT+1:23"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_P0023, "GMT+0:23"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_P012345, "GMT+1:23:45"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M000045, "GMT-0:00:45"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M0100, "GMT-1"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M0123, "GMT-1:23"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M0023, "GMT-0:23"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M012345, "GMT-1:23:45"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M000045, "GMT-0:00:45"},
    };
}
 
Example 11
Source File: TestTextPrinter.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="print_JapaneseChronology")
Object[][] provider_japaneseEra() {
   return new Object[][] {
        {ERA,           TextStyle.FULL, 2, "Heisei"}, // Note: CLDR doesn't define "wide" Japanese era names.
        {ERA,           TextStyle.SHORT, 2, "Heisei"},
        {ERA,           TextStyle.NARROW, 2, "H"},
   };
}
 
Example 12
Source File: TestTextPrinter.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="print_JapaneseChronology")
Object[][] provider_japaneseEra() {
   return new Object[][] {
        {ERA,           TextStyle.FULL, 2, "Heisei"}, // Note: CLDR doesn't define "wide" Japanese era names.
        {ERA,           TextStyle.SHORT, 2, "Heisei"},
        {ERA,           TextStyle.NARROW, 2, "H"},
   };
}
 
Example 13
Source File: TestTextParser.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="parseNumber")
Object[][] provider_number() {
    return new Object[][] {
        {DAY_OF_MONTH, TextStyle.FULL, 1, "1"},
        {DAY_OF_MONTH, TextStyle.FULL, 2, "2"},
        {DAY_OF_MONTH, TextStyle.FULL, 30, "30"},
        {DAY_OF_MONTH, TextStyle.FULL, 31, "31"},

        {DAY_OF_MONTH, TextStyle.SHORT, 1, "1"},
        {DAY_OF_MONTH, TextStyle.SHORT, 2, "2"},
        {DAY_OF_MONTH, TextStyle.SHORT, 30, "30"},
        {DAY_OF_MONTH, TextStyle.SHORT, 31, "31"},
   };
}
 
Example 14
Source File: TCKOffsetPrinterParser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="print_localized")
public void test_print_localized(TextStyle style, LocalDateTime ldt, ZoneOffset offset, String expected) {
    OffsetDateTime odt = OffsetDateTime.of(ldt, offset);
    ZonedDateTime zdt = ldt.atZone(offset);

    DateTimeFormatter f = new DateTimeFormatterBuilder().appendLocalizedOffset(style)
                                                        .toFormatter();
    assertEquals(f.format(odt), expected);
    assertEquals(f.format(zdt), expected);
    assertEquals(f.parse(expected, ZoneOffset::from), offset);

    if (style == TextStyle.FULL) {
        f = new DateTimeFormatterBuilder().appendPattern("ZZZZ")
                                          .toFormatter();
        assertEquals(f.format(odt), expected);
        assertEquals(f.format(zdt), expected);
        assertEquals(f.parse(expected, ZoneOffset::from), offset);

        f = new DateTimeFormatterBuilder().appendPattern("OOOO")
                                          .toFormatter();
        assertEquals(f.format(odt), expected);
        assertEquals(f.format(zdt), expected);
        assertEquals(f.parse(expected, ZoneOffset::from), offset);
    }

    if (style == TextStyle.SHORT) {
        f = new DateTimeFormatterBuilder().appendPattern("O")
                                          .toFormatter();
        assertEquals(f.format(odt), expected);
        assertEquals(f.format(zdt), expected);
        assertEquals(f.parse(expected, ZoneOffset::from), offset);
    }
}
 
Example 15
Source File: TestDateTimeTextProvider.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name = "Text")
Object[][] data_text() {
    return new Object[][] {
        {DAY_OF_WEEK, 1, TextStyle.SHORT, enUS, "Mon"},
        {DAY_OF_WEEK, 2, TextStyle.SHORT, enUS, "Tue"},
        {DAY_OF_WEEK, 3, TextStyle.SHORT, enUS, "Wed"},
        {DAY_OF_WEEK, 4, TextStyle.SHORT, enUS, "Thu"},
        {DAY_OF_WEEK, 5, TextStyle.SHORT, enUS, "Fri"},
        {DAY_OF_WEEK, 6, TextStyle.SHORT, enUS, "Sat"},
        {DAY_OF_WEEK, 7, TextStyle.SHORT, enUS, "Sun"},

        {DAY_OF_WEEK, 1, TextStyle.SHORT, ptBR, "Seg"},
        {DAY_OF_WEEK, 2, TextStyle.SHORT, ptBR, "Ter"},
        {DAY_OF_WEEK, 3, TextStyle.SHORT, ptBR, "Qua"},
        {DAY_OF_WEEK, 4, TextStyle.SHORT, ptBR, "Qui"},
        {DAY_OF_WEEK, 5, TextStyle.SHORT, ptBR, "Sex"},
        {DAY_OF_WEEK, 6, TextStyle.SHORT, ptBR, "S\u00E1b"},
        {DAY_OF_WEEK, 7, TextStyle.SHORT, ptBR, "Dom"},

        {DAY_OF_WEEK, 1, TextStyle.FULL, enUS, "Monday"},
        {DAY_OF_WEEK, 2, TextStyle.FULL, enUS, "Tuesday"},
        {DAY_OF_WEEK, 3, TextStyle.FULL, enUS, "Wednesday"},
        {DAY_OF_WEEK, 4, TextStyle.FULL, enUS, "Thursday"},
        {DAY_OF_WEEK, 5, TextStyle.FULL, enUS, "Friday"},
        {DAY_OF_WEEK, 6, TextStyle.FULL, enUS, "Saturday"},
        {DAY_OF_WEEK, 7, TextStyle.FULL, enUS, "Sunday"},

        {DAY_OF_WEEK, 1, TextStyle.FULL, ptBR, "Segunda-feira"},
        {DAY_OF_WEEK, 2, TextStyle.FULL, ptBR, "Ter\u00E7a-feira"},
        {DAY_OF_WEEK, 3, TextStyle.FULL, ptBR, "Quarta-feira"},
        {DAY_OF_WEEK, 4, TextStyle.FULL, ptBR, "Quinta-feira"},
        {DAY_OF_WEEK, 5, TextStyle.FULL, ptBR, "Sexta-feira"},
        {DAY_OF_WEEK, 6, TextStyle.FULL, ptBR, "S\u00E1bado"},
        {DAY_OF_WEEK, 7, TextStyle.FULL, ptBR, "Domingo"},

        {MONTH_OF_YEAR, 1, TextStyle.SHORT, enUS, "Jan"},
        {MONTH_OF_YEAR, 2, TextStyle.SHORT, enUS, "Feb"},
        {MONTH_OF_YEAR, 3, TextStyle.SHORT, enUS, "Mar"},
        {MONTH_OF_YEAR, 4, TextStyle.SHORT, enUS, "Apr"},
        {MONTH_OF_YEAR, 5, TextStyle.SHORT, enUS, "May"},
        {MONTH_OF_YEAR, 6, TextStyle.SHORT, enUS, "Jun"},
        {MONTH_OF_YEAR, 7, TextStyle.SHORT, enUS, "Jul"},
        {MONTH_OF_YEAR, 8, TextStyle.SHORT, enUS, "Aug"},
        {MONTH_OF_YEAR, 9, TextStyle.SHORT, enUS, "Sep"},
        {MONTH_OF_YEAR, 10, TextStyle.SHORT, enUS, "Oct"},
        {MONTH_OF_YEAR, 11, TextStyle.SHORT, enUS, "Nov"},
        {MONTH_OF_YEAR, 12, TextStyle.SHORT, enUS, "Dec"},

        {MONTH_OF_YEAR, 1, TextStyle.SHORT, ptBR, "jan"},
        {MONTH_OF_YEAR, 2, TextStyle.SHORT, ptBR, "fev"},
        {MONTH_OF_YEAR, 3, TextStyle.SHORT, ptBR, "mar"},
        {MONTH_OF_YEAR, 4, TextStyle.SHORT, ptBR, "abr"},
        {MONTH_OF_YEAR, 5, TextStyle.SHORT, ptBR, "mai"},
        {MONTH_OF_YEAR, 6, TextStyle.SHORT, ptBR, "jun"},
        {MONTH_OF_YEAR, 7, TextStyle.SHORT, ptBR, "jul"},
        {MONTH_OF_YEAR, 8, TextStyle.SHORT, ptBR, "ago"},
        {MONTH_OF_YEAR, 9, TextStyle.SHORT, ptBR, "set"},
        {MONTH_OF_YEAR, 10, TextStyle.SHORT, ptBR, "out"},
        {MONTH_OF_YEAR, 11, TextStyle.SHORT, ptBR, "nov"},
        {MONTH_OF_YEAR, 12, TextStyle.SHORT, ptBR, "dez"},

        {MONTH_OF_YEAR, 1, TextStyle.FULL, enUS, "January"},
        {MONTH_OF_YEAR, 2, TextStyle.FULL, enUS, "February"},
        {MONTH_OF_YEAR, 3, TextStyle.FULL, enUS, "March"},
        {MONTH_OF_YEAR, 4, TextStyle.FULL, enUS, "April"},
        {MONTH_OF_YEAR, 5, TextStyle.FULL, enUS, "May"},
        {MONTH_OF_YEAR, 6, TextStyle.FULL, enUS, "June"},
        {MONTH_OF_YEAR, 7, TextStyle.FULL, enUS, "July"},
        {MONTH_OF_YEAR, 8, TextStyle.FULL, enUS, "August"},
        {MONTH_OF_YEAR, 9, TextStyle.FULL, enUS, "September"},
        {MONTH_OF_YEAR, 10, TextStyle.FULL, enUS, "October"},
        {MONTH_OF_YEAR, 11, TextStyle.FULL, enUS, "November"},
        {MONTH_OF_YEAR, 12, TextStyle.FULL, enUS, "December"},

        {MONTH_OF_YEAR, 1, TextStyle.FULL, ptBR, "Janeiro"},
        {MONTH_OF_YEAR, 2, TextStyle.FULL, ptBR, "Fevereiro"},
        {MONTH_OF_YEAR, 3, TextStyle.FULL, ptBR, "Mar\u00E7o"},
        {MONTH_OF_YEAR, 4, TextStyle.FULL, ptBR, "Abril"},
        {MONTH_OF_YEAR, 5, TextStyle.FULL, ptBR, "Maio"},
        {MONTH_OF_YEAR, 6, TextStyle.FULL, ptBR, "Junho"},
        {MONTH_OF_YEAR, 7, TextStyle.FULL, ptBR, "Julho"},
        {MONTH_OF_YEAR, 8, TextStyle.FULL, ptBR, "Agosto"},
        {MONTH_OF_YEAR, 9, TextStyle.FULL, ptBR, "Setembro"},
        {MONTH_OF_YEAR, 10, TextStyle.FULL, ptBR, "Outubro"},
        {MONTH_OF_YEAR, 11, TextStyle.FULL, ptBR, "Novembro"},
        {MONTH_OF_YEAR, 12, TextStyle.FULL, ptBR, "Dezembro"},

        {AMPM_OF_DAY, 0, TextStyle.SHORT, enUS, "AM"},
        {AMPM_OF_DAY, 1, TextStyle.SHORT, enUS, "PM"},

    };
}
 
Example 16
Source File: TestTextParser.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name="parseText")
Object[][] provider_text() {
    return new Object[][] {
        {DAY_OF_WEEK, TextStyle.FULL, 1, "Monday"},
        {DAY_OF_WEEK, TextStyle.FULL, 2, "Tuesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 3, "Wednesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 4, "Thursday"},
        {DAY_OF_WEEK, TextStyle.FULL, 5, "Friday"},
        {DAY_OF_WEEK, TextStyle.FULL, 6, "Saturday"},
        {DAY_OF_WEEK, TextStyle.FULL, 7, "Sunday"},

        {DAY_OF_WEEK, TextStyle.SHORT, 1, "Mon"},
        {DAY_OF_WEEK, TextStyle.SHORT, 2, "Tue"},
        {DAY_OF_WEEK, TextStyle.SHORT, 3, "Wed"},
        {DAY_OF_WEEK, TextStyle.SHORT, 4, "Thu"},
        {DAY_OF_WEEK, TextStyle.SHORT, 5, "Fri"},
        {DAY_OF_WEEK, TextStyle.SHORT, 6, "Sat"},
        {DAY_OF_WEEK, TextStyle.SHORT, 7, "Sun"},

        {MONTH_OF_YEAR, TextStyle.FULL, 1, "January"},
        {MONTH_OF_YEAR, TextStyle.FULL, 12, "December"},

        {MONTH_OF_YEAR, TextStyle.SHORT, 1, "Jan"},
        {MONTH_OF_YEAR, TextStyle.SHORT, 12, "Dec"},

        {QUARTER_OF_YEAR, TextStyle.FULL, 1, "1st quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 2, "2nd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 3, "3rd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 4, "4th quarter"},

        {QUARTER_OF_YEAR, TextStyle.SHORT, 1, "Q1"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 2, "Q2"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 3, "Q3"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 4, "Q4"},

        {QUARTER_OF_YEAR, TextStyle.NARROW, 1, "1"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 2, "2"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 3, "3"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 4, "4"},
   };
}
 
Example 17
Source File: TCKDateTimeTextPrinting.java    From j2objc with Apache License 2.0 4 votes vote down vote up
@DataProvider
public static Object[][] data_text() {
    return new Object[][] {
        {DAY_OF_WEEK, TextStyle.FULL, 1, "Monday"},
        {DAY_OF_WEEK, TextStyle.FULL, 2, "Tuesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 3, "Wednesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 4, "Thursday"},
        {DAY_OF_WEEK, TextStyle.FULL, 5, "Friday"},
        {DAY_OF_WEEK, TextStyle.FULL, 6, "Saturday"},
        {DAY_OF_WEEK, TextStyle.FULL, 7, "Sunday"},

        {DAY_OF_WEEK, TextStyle.SHORT, 1, "Mon"},
        {DAY_OF_WEEK, TextStyle.SHORT, 2, "Tue"},
        {DAY_OF_WEEK, TextStyle.SHORT, 3, "Wed"},
        {DAY_OF_WEEK, TextStyle.SHORT, 4, "Thu"},
        {DAY_OF_WEEK, TextStyle.SHORT, 5, "Fri"},
        {DAY_OF_WEEK, TextStyle.SHORT, 6, "Sat"},
        {DAY_OF_WEEK, TextStyle.SHORT, 7, "Sun"},

        {DAY_OF_MONTH, TextStyle.FULL, 1, "1"},
        {DAY_OF_MONTH, TextStyle.FULL, 2, "2"},
        {DAY_OF_MONTH, TextStyle.FULL, 3, "3"},
        {DAY_OF_MONTH, TextStyle.FULL, 28, "28"},
        {DAY_OF_MONTH, TextStyle.FULL, 29, "29"},
        {DAY_OF_MONTH, TextStyle.FULL, 30, "30"},
        {DAY_OF_MONTH, TextStyle.FULL, 31, "31"},

        {DAY_OF_MONTH, TextStyle.SHORT, 1, "1"},
        {DAY_OF_MONTH, TextStyle.SHORT, 2, "2"},
        {DAY_OF_MONTH, TextStyle.SHORT, 3, "3"},
        {DAY_OF_MONTH, TextStyle.SHORT, 28, "28"},
        {DAY_OF_MONTH, TextStyle.SHORT, 29, "29"},
        {DAY_OF_MONTH, TextStyle.SHORT, 30, "30"},
        {DAY_OF_MONTH, TextStyle.SHORT, 31, "31"},

        {MONTH_OF_YEAR, TextStyle.FULL, 1, "January"},
        {MONTH_OF_YEAR, TextStyle.FULL, 12, "December"},

        {MONTH_OF_YEAR, TextStyle.SHORT, 1, "Jan"},
        {MONTH_OF_YEAR, TextStyle.SHORT, 12, "Dec"},
   };
}
 
Example 18
Source File: TestTextParser.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name="parseText")
Object[][] provider_text() {
    return new Object[][] {
        {DAY_OF_WEEK, TextStyle.FULL, 1, "Monday"},
        {DAY_OF_WEEK, TextStyle.FULL, 2, "Tuesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 3, "Wednesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 4, "Thursday"},
        {DAY_OF_WEEK, TextStyle.FULL, 5, "Friday"},
        {DAY_OF_WEEK, TextStyle.FULL, 6, "Saturday"},
        {DAY_OF_WEEK, TextStyle.FULL, 7, "Sunday"},

        {DAY_OF_WEEK, TextStyle.SHORT, 1, "Mon"},
        {DAY_OF_WEEK, TextStyle.SHORT, 2, "Tue"},
        {DAY_OF_WEEK, TextStyle.SHORT, 3, "Wed"},
        {DAY_OF_WEEK, TextStyle.SHORT, 4, "Thu"},
        {DAY_OF_WEEK, TextStyle.SHORT, 5, "Fri"},
        {DAY_OF_WEEK, TextStyle.SHORT, 6, "Sat"},
        {DAY_OF_WEEK, TextStyle.SHORT, 7, "Sun"},

        {MONTH_OF_YEAR, TextStyle.FULL, 1, "January"},
        {MONTH_OF_YEAR, TextStyle.FULL, 12, "December"},

        {MONTH_OF_YEAR, TextStyle.SHORT, 1, "Jan"},
        {MONTH_OF_YEAR, TextStyle.SHORT, 12, "Dec"},

        {QUARTER_OF_YEAR, TextStyle.FULL, 1, "1st quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 2, "2nd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 3, "3rd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 4, "4th quarter"},

        {QUARTER_OF_YEAR, TextStyle.SHORT, 1, "Q1"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 2, "Q2"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 3, "Q3"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 4, "Q4"},

        {QUARTER_OF_YEAR, TextStyle.NARROW, 1, "1"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 2, "2"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 3, "3"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 4, "4"},
   };
}
 
Example 19
Source File: TestDateTimeTextProvider.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name = "Text")
Object[][] data_text() {
    return new Object[][] {
        {DAY_OF_WEEK, 1, TextStyle.SHORT, enUS, "Mon"},
        {DAY_OF_WEEK, 2, TextStyle.SHORT, enUS, "Tue"},
        {DAY_OF_WEEK, 3, TextStyle.SHORT, enUS, "Wed"},
        {DAY_OF_WEEK, 4, TextStyle.SHORT, enUS, "Thu"},
        {DAY_OF_WEEK, 5, TextStyle.SHORT, enUS, "Fri"},
        {DAY_OF_WEEK, 6, TextStyle.SHORT, enUS, "Sat"},
        {DAY_OF_WEEK, 7, TextStyle.SHORT, enUS, "Sun"},

        {DAY_OF_WEEK, 1, TextStyle.SHORT, ptBR, "Seg"},
        {DAY_OF_WEEK, 2, TextStyle.SHORT, ptBR, "Ter"},
        {DAY_OF_WEEK, 3, TextStyle.SHORT, ptBR, "Qua"},
        {DAY_OF_WEEK, 4, TextStyle.SHORT, ptBR, "Qui"},
        {DAY_OF_WEEK, 5, TextStyle.SHORT, ptBR, "Sex"},
        {DAY_OF_WEEK, 6, TextStyle.SHORT, ptBR, "S\u00E1b"},
        {DAY_OF_WEEK, 7, TextStyle.SHORT, ptBR, "Dom"},

        {DAY_OF_WEEK, 1, TextStyle.FULL, enUS, "Monday"},
        {DAY_OF_WEEK, 2, TextStyle.FULL, enUS, "Tuesday"},
        {DAY_OF_WEEK, 3, TextStyle.FULL, enUS, "Wednesday"},
        {DAY_OF_WEEK, 4, TextStyle.FULL, enUS, "Thursday"},
        {DAY_OF_WEEK, 5, TextStyle.FULL, enUS, "Friday"},
        {DAY_OF_WEEK, 6, TextStyle.FULL, enUS, "Saturday"},
        {DAY_OF_WEEK, 7, TextStyle.FULL, enUS, "Sunday"},

        {DAY_OF_WEEK, 1, TextStyle.FULL, ptBR, "Segunda-feira"},
        {DAY_OF_WEEK, 2, TextStyle.FULL, ptBR, "Ter\u00E7a-feira"},
        {DAY_OF_WEEK, 3, TextStyle.FULL, ptBR, "Quarta-feira"},
        {DAY_OF_WEEK, 4, TextStyle.FULL, ptBR, "Quinta-feira"},
        {DAY_OF_WEEK, 5, TextStyle.FULL, ptBR, "Sexta-feira"},
        {DAY_OF_WEEK, 6, TextStyle.FULL, ptBR, "S\u00E1bado"},
        {DAY_OF_WEEK, 7, TextStyle.FULL, ptBR, "Domingo"},

        {MONTH_OF_YEAR, 1, TextStyle.SHORT, enUS, "Jan"},
        {MONTH_OF_YEAR, 2, TextStyle.SHORT, enUS, "Feb"},
        {MONTH_OF_YEAR, 3, TextStyle.SHORT, enUS, "Mar"},
        {MONTH_OF_YEAR, 4, TextStyle.SHORT, enUS, "Apr"},
        {MONTH_OF_YEAR, 5, TextStyle.SHORT, enUS, "May"},
        {MONTH_OF_YEAR, 6, TextStyle.SHORT, enUS, "Jun"},
        {MONTH_OF_YEAR, 7, TextStyle.SHORT, enUS, "Jul"},
        {MONTH_OF_YEAR, 8, TextStyle.SHORT, enUS, "Aug"},
        {MONTH_OF_YEAR, 9, TextStyle.SHORT, enUS, "Sep"},
        {MONTH_OF_YEAR, 10, TextStyle.SHORT, enUS, "Oct"},
        {MONTH_OF_YEAR, 11, TextStyle.SHORT, enUS, "Nov"},
        {MONTH_OF_YEAR, 12, TextStyle.SHORT, enUS, "Dec"},

        {MONTH_OF_YEAR, 1, TextStyle.SHORT, ptBR, "jan"},
        {MONTH_OF_YEAR, 2, TextStyle.SHORT, ptBR, "fev"},
        {MONTH_OF_YEAR, 3, TextStyle.SHORT, ptBR, "mar"},
        {MONTH_OF_YEAR, 4, TextStyle.SHORT, ptBR, "abr"},
        {MONTH_OF_YEAR, 5, TextStyle.SHORT, ptBR, "mai"},
        {MONTH_OF_YEAR, 6, TextStyle.SHORT, ptBR, "jun"},
        {MONTH_OF_YEAR, 7, TextStyle.SHORT, ptBR, "jul"},
        {MONTH_OF_YEAR, 8, TextStyle.SHORT, ptBR, "ago"},
        {MONTH_OF_YEAR, 9, TextStyle.SHORT, ptBR, "set"},
        {MONTH_OF_YEAR, 10, TextStyle.SHORT, ptBR, "out"},
        {MONTH_OF_YEAR, 11, TextStyle.SHORT, ptBR, "nov"},
        {MONTH_OF_YEAR, 12, TextStyle.SHORT, ptBR, "dez"},

        {MONTH_OF_YEAR, 1, TextStyle.FULL, enUS, "January"},
        {MONTH_OF_YEAR, 2, TextStyle.FULL, enUS, "February"},
        {MONTH_OF_YEAR, 3, TextStyle.FULL, enUS, "March"},
        {MONTH_OF_YEAR, 4, TextStyle.FULL, enUS, "April"},
        {MONTH_OF_YEAR, 5, TextStyle.FULL, enUS, "May"},
        {MONTH_OF_YEAR, 6, TextStyle.FULL, enUS, "June"},
        {MONTH_OF_YEAR, 7, TextStyle.FULL, enUS, "July"},
        {MONTH_OF_YEAR, 8, TextStyle.FULL, enUS, "August"},
        {MONTH_OF_YEAR, 9, TextStyle.FULL, enUS, "September"},
        {MONTH_OF_YEAR, 10, TextStyle.FULL, enUS, "October"},
        {MONTH_OF_YEAR, 11, TextStyle.FULL, enUS, "November"},
        {MONTH_OF_YEAR, 12, TextStyle.FULL, enUS, "December"},

        {MONTH_OF_YEAR, 1, TextStyle.FULL, ptBR, "Janeiro"},
        {MONTH_OF_YEAR, 2, TextStyle.FULL, ptBR, "Fevereiro"},
        {MONTH_OF_YEAR, 3, TextStyle.FULL, ptBR, "Mar\u00E7o"},
        {MONTH_OF_YEAR, 4, TextStyle.FULL, ptBR, "Abril"},
        {MONTH_OF_YEAR, 5, TextStyle.FULL, ptBR, "Maio"},
        {MONTH_OF_YEAR, 6, TextStyle.FULL, ptBR, "Junho"},
        {MONTH_OF_YEAR, 7, TextStyle.FULL, ptBR, "Julho"},
        {MONTH_OF_YEAR, 8, TextStyle.FULL, ptBR, "Agosto"},
        {MONTH_OF_YEAR, 9, TextStyle.FULL, ptBR, "Setembro"},
        {MONTH_OF_YEAR, 10, TextStyle.FULL, ptBR, "Outubro"},
        {MONTH_OF_YEAR, 11, TextStyle.FULL, ptBR, "Novembro"},
        {MONTH_OF_YEAR, 12, TextStyle.FULL, ptBR, "Dezembro"},

        {AMPM_OF_DAY, 0, TextStyle.SHORT, enUS, "AM"},
        {AMPM_OF_DAY, 1, TextStyle.SHORT, enUS, "PM"},

    };
}
 
Example 20
Source File: DefaultDateFunctions.java    From jackcess with Apache License 2.0 4 votes vote down vote up
private static TextStyle getTextStyle(EvalContext ctx, Value[] params,
                                      int idx) {
  boolean abbreviate = getOptionalBooleanParam(ctx, params, idx);
  return (abbreviate ? TextStyle.SHORT : TextStyle.FULL);
}