Home
last modified time | relevance | path

Searched refs:Calendar (Results 1 – 25 of 79) sorted by relevance

1234

/libcore/luni/src/test/java/libcore/java/util/
DCalendarWeekOfMonthTest.java19 import java.util.Calendar;
50 { 1462107600000L, "01 May 2016", Calendar.MONDAY, 4, 0 }, in data()
51 { 1462194000000L, "02 May 2016", Calendar.MONDAY, 4, 1 }, in data()
52 { 1462798800000L, "09 May 2016", Calendar.MONDAY, 4, 2 }, in data()
53 { 1463403600000L, "16 May 2016", Calendar.MONDAY, 4, 3 }, in data()
54 { 1464008400000L, "23 May 2016", Calendar.MONDAY, 4, 4 }, in data()
55 { 1464613200000L, "30 May 2016", Calendar.MONDAY, 4, 5 }, in data()
56 { 1464786000000L, "01 Jun 2016", Calendar.MONDAY, 4, 1 }, in data()
57 { 1465218000000L, "06 Jun 2016", Calendar.MONDAY, 4, 2 }, in data()
58 { 1465822800000L, "13 Jun 2016", Calendar.MONDAY, 4, 3 }, in data()
[all …]
DCalendarBuilderTest.java20 import java.util.Calendar;
37 Calendar.Builder builder = new Calendar.Builder(); in test_default_values()
45 Calendar.Builder builder = new Calendar.Builder(); in test_setCalendarType_iso8601()
51 expected.setFirstDayOfWeek(Calendar.MONDAY); in test_setCalendarType_iso8601()
58 Calendar.Builder builder = new Calendar.Builder(); in test_setCalendarType_invalid()
75 Calendar.Builder builder = new Calendar.Builder(); in test_setCalendarType_reset()
85 Calendar.Builder builder = new Calendar.Builder(); in test_setDate()
86 builder.setDate(2000, Calendar.FEBRUARY, 3); in test_setDate()
89 expected.set(2000, Calendar.FEBRUARY, 3); in test_setDate()
95 Calendar.Builder builder = new Calendar.Builder(); in test_setTimeOfDay()
[all …]
DSimpleTimeZoneTest.java20 import java.util.Calendar;
55 Calendar.MARCH, -1, Calendar.SUNDAY, 3600000, SimpleTimeZone.UTC_TIME, in testDstParis2014_LastSundayMarch_LastSundayOctober_UtcTime()
56 Calendar.OCTOBER, -1, Calendar.SUNDAY, 3600000, SimpleTimeZone.UTC_TIME, 3600000); in testDstParis2014_LastSundayMarch_LastSundayOctober_UtcTime()
63 Calendar.MARCH, 25, -Calendar.SUNDAY, 3600000, SimpleTimeZone.UTC_TIME, in testDstParis2014_SundayAfter25thMarch_SundayAfter25thOctober_UtcTime()
64 Calendar.OCTOBER, 25, -Calendar.SUNDAY, 3600000, SimpleTimeZone.UTC_TIME, 3600000); in testDstParis2014_SundayAfter25thMarch_SundayAfter25thOctober_UtcTime()
71 Calendar.MARCH, 30, 0, 3600000, SimpleTimeZone.UTC_TIME, in testDstParis2014_30thMarch_26thOctober_UtcTime()
72 Calendar.OCTOBER, 26, 0, 3600000, SimpleTimeZone.UTC_TIME, 3600000); in testDstParis2014_30thMarch_26thOctober_UtcTime()
89 Calendar.APRIL, 1, -Calendar.SUNDAY, 7200000, in testDst_1stSundayApril_1stSundayOctober_DefaultTime()
90 Calendar.OCTOBER, -1, Calendar.SUNDAY, 7200000, in testDst_1stSundayApril_1stSundayOctober_DefaultTime()
114 Calendar.MARCH, 2, Calendar.SUNDAY, 7200000, SimpleTimeZone.STANDARD_TIME, in testDstNewYork2014_2ndSundayMarch_1stSundayNovember_StandardTime()
[all …]
DGregorianCalendarTest.java23 import java.util.Calendar;
41 Calendar.MARCH, 9, 0, hours(2),
42 Calendar.NOVEMBER, 2, 0, hours(2),
66 Calendar greg = new GregorianCalendar(LOS_ANGELES, Locale.ENGLISH); in test_computeFields_dayOfWeekAndWeekOfYearSet()
69 int differentWeekOfYear = greg.get(Calendar.WEEK_OF_YEAR) == 1 ? 2 : 1; in test_computeFields_dayOfWeekAndWeekOfYearSet()
70 int differentDayOfWeek = greg.get(Calendar.DAY_OF_WEEK) == Calendar.MONDAY in test_computeFields_dayOfWeekAndWeekOfYearSet()
71 ? Calendar.TUESDAY : Calendar.MONDAY; in test_computeFields_dayOfWeekAndWeekOfYearSet()
75 greg.set(Calendar.WEEK_OF_YEAR, differentWeekOfYear); in test_computeFields_dayOfWeekAndWeekOfYearSet()
76 assertEquals(differentWeekOfYear, greg.get(Calendar.WEEK_OF_YEAR)); in test_computeFields_dayOfWeekAndWeekOfYearSet()
77 greg.set(Calendar.DAY_OF_WEEK, differentDayOfWeek); in test_computeFields_dayOfWeekAndWeekOfYearSet()
[all …]
DCalendarTest.java21 import java.util.Calendar;
51 Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"), Locale.US); in test_setTimeZone()
52 assertEquals(0, cal.get(Calendar.ZONE_OFFSET)); in test_setTimeZone()
55 assertEquals(25200000, cal.get(Calendar.ZONE_OFFSET)); in test_setTimeZone()
59 Calendar calendar = new GregorianCalendar(AMERICA_SAO_PAULO); in testAddOneDayOverDstForwardAdds23HoursAt0100()
62 calendar.add(Calendar.DATE, 1); in testAddOneDayOverDstForwardAdds23HoursAt0100()
75 Calendar calendar = new GregorianCalendar(AMERICA_SAO_PAULO); in testAddOneDayOverDstForwardAdds24HoursAt0000()
78 calendar.add(Calendar.DATE, 1); in testAddOneDayOverDstForwardAdds24HoursAt0000()
84 Calendar calendar = new GregorianCalendar(AMERICA_SAO_PAULO); in testAddOneDayOverDstBackAdds25HoursAt0000()
87 calendar.add(Calendar.DATE, 1); in testAddOneDayOverDstBackAdds25HoursAt0000()
[all …]
DOldGregorianCalendarTest.java20 import java.util.Calendar;
38 assertTrue(gc2.get(Calendar.HOUR) == ((gc1.get(Calendar.HOUR) + 1) % 12)); in testGetHour()
60 assertEquals(1, g.get(Calendar.ERA)); in test_computeFields()
61 assertEquals(2008, g.get(Calendar.YEAR)); in test_computeFields()
62 assertEquals(Calendar.SEPTEMBER, g.get(Calendar.MONTH)); in test_computeFields()
63 assertEquals(23, g.get(Calendar.DAY_OF_MONTH)); in test_computeFields()
64 assertEquals(17, g.get(Calendar.HOUR_OF_DAY)); in test_computeFields()
65 assertEquals(0, g.get(Calendar.MINUTE)); in test_computeFields()
78 g1.set(2008, Calendar.SEPTEMBER, 23, 18, 0, 0); in test_hashCode()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DCalendarTest.java22 import java.util.Calendar;
41 Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("EST")); in test_setII()
44 cal.set(Calendar.YEAR, 2002); in test_setII()
49 cal.set(Calendar.YEAR, 2002); in test_setII()
50 cal.set(Calendar.MONTH, Calendar.MARCH); in test_setII()
55 cal.set(Calendar.YEAR, 2002); in test_setII()
56 cal.set(Calendar.DATE, 24); in test_setII()
60 cal.set(Calendar.MONTH, Calendar.OCTOBER); in test_setII()
61 cal.set(Calendar.DATE, 31); in test_setII()
62 cal.set(Calendar.MONTH, Calendar.NOVEMBER); in test_setII()
[all …]
DGregorianCalendarTest.java21 import java.util.Calendar;
64 GregorianCalendar gc = new GregorianCalendar(1972, Calendar.OCTOBER, 13); in test_ConstructorIII()
66 1972, gc.get(Calendar.YEAR)); in test_ConstructorIII()
68 gc.get(Calendar.MONTH) == Calendar.OCTOBER); in test_ConstructorIII()
70 .get(Calendar.DAY_OF_MONTH)); in test_ConstructorIII()
81 GregorianCalendar gc = new GregorianCalendar(1972, Calendar.OCTOBER, in test_ConstructorIIIII()
84 1972, gc.get(Calendar.YEAR)); in test_ConstructorIIIII()
86 gc.get(Calendar.MONTH) == Calendar.OCTOBER); in test_ConstructorIIIII()
88 .get(Calendar.DAY_OF_MONTH)); in test_ConstructorIIIII()
89 assertEquals("Incorrect calendar constructed", 7, gc.get(Calendar.HOUR)); in test_ConstructorIIIII()
[all …]
DSimpleTimeZoneTest.java20 import java.util.Calendar;
53 SimpleTimeZone st = new SimpleTimeZone(1000, "TEST", Calendar.NOVEMBER, in test_ConstructorILjava_lang_StringIIIIIIII()
54 1, Calendar.SUNDAY, 0, Calendar.NOVEMBER, -1, Calendar.SUNDAY, in test_ConstructorILjava_lang_StringIIIIIIII()
57 .inDaylightTime(new GregorianCalendar(1998, Calendar.NOVEMBER, in test_ConstructorILjava_lang_StringIIIIIIII()
60 .inDaylightTime(new GregorianCalendar(1998, Calendar.OCTOBER, in test_ConstructorILjava_lang_StringIIIIIIII()
68 1, Calendar.SUNDAY, 0, Calendar.NOVEMBER, -1, Calendar.SUNDAY, in test_ConstructorILjava_lang_StringIIIIIIII()
76 new SimpleTimeZone(1000, "TEST", Calendar.NOVEMBER, in test_ConstructorILjava_lang_StringIIIIIIII()
77 10, Calendar.SUNDAY, 0, Calendar.NOVEMBER, -1, Calendar.SUNDAY, in test_ConstructorILjava_lang_StringIIIIIIII()
85 new SimpleTimeZone(1000, "TEST", Calendar.NOVEMBER, in test_ConstructorILjava_lang_StringIIIIIIII()
86 1, 10, 0, Calendar.NOVEMBER, -1, Calendar.SUNDAY, in test_ConstructorILjava_lang_StringIIIIIIII()
[all …]
DDateTest.java21 import java.util.Calendar;
34 GregorianCalendar gc = new GregorianCalendar(1998, Calendar.OCTOBER, in test_Constructor()
55 Calendar cal = new GregorianCalendar(1999, Calendar.JUNE, 22); in test_ConstructorIII()
203 Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9) in test_getDate()
213 Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9) in test_getDay()
223 Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9) in test_getHours()
233 Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9) in test_getMinutes()
243 Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9) in test_getMonth()
253 Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9) in test_getSeconds()
282 Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9) in test_getYear()
[all …]
/libcore/luni/src/main/java/libcore/icu/
DDateUtilsBridge.java20 import android.icu.util.Calendar;
59 public static Calendar createIcuCalendar(android.icu.util.TimeZone icuTimeZone, ULocale icuLocale, in createIcuCalendar()
61 Calendar calendar = new GregorianCalendar(icuTimeZone, icuLocale); in createIcuCalendar()
66 public static String toSkeleton(Calendar calendar, int flags) { in toSkeleton()
70 public static String toSkeleton(Calendar startCalendar, Calendar endCalendar, int flags) { in toSkeleton()
150 public static int dayDistance(Calendar c1, Calendar c2) { in dayDistance()
151 return c2.get(Calendar.JULIAN_DAY) - c1.get(Calendar.JULIAN_DAY); in dayDistance()
154 private static boolean onTheHour(Calendar c) { in onTheHour()
155 return c.get(Calendar.MINUTE) == 0 && c.get(Calendar.SECOND) == 0; in onTheHour()
158 private static boolean fallOnDifferentDates(Calendar c1, Calendar c2) { in fallOnDifferentDates()
[all …]
DDateIntervalFormat.java19 import android.icu.util.Calendar;
56 Calendar startCalendar = DateUtilsBridge.createIcuCalendar(icuTimeZone, icuLocale, startMs); in formatDateRange()
57 Calendar endCalendar; in formatDateRange()
73 endCalendar.add(Calendar.DAY_OF_MONTH, -1); in formatDateRange()
98 private static boolean isMidnight(Calendar c) { in isMidnight()
99 return c.get(Calendar.HOUR_OF_DAY) == 0 && in isMidnight()
100 c.get(Calendar.MINUTE) == 0 && in isMidnight()
101 c.get(Calendar.SECOND) == 0 && in isMidnight()
102 c.get(Calendar.MILLISECOND) == 0; in isMidnight()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
DDataFormatFieldTest.java29 import java.util.Calendar;
37 MyField field = new MyField("day of month", Calendar.ERA); in test_ConstructorLjava_lang_StringLjava_lang_String()
40 assertEquals("field has wrong Calendar field number", Calendar.ERA, in test_ConstructorLjava_lang_StringLjava_lang_String()
44 .ofCalendarField(Calendar.ERA); in test_ConstructorLjava_lang_StringLjava_lang_String()
49 .ofCalendarField(Calendar.DAY_OF_MONTH); in test_ConstructorLjava_lang_StringLjava_lang_String()
70 MyField field = new MyField("a field", Calendar.DAY_OF_WEEK); in test_ConstructorLjava_lang_StringI()
74 Calendar.DAY_OF_WEEK, field.getCalendarField()); in test_ConstructorLjava_lang_StringI()
77 .ofCalendarField(Calendar.DAY_OF_WEEK); in test_ConstructorLjava_lang_StringI()
86 MyField field = new MyField("day of month", Calendar.ERA); in test_Constructor2()
89 assertEquals("field has wrong Calendar field number", Calendar.ERA, in test_Constructor2()
[all …]
DSimpleDateFormatTest.java25 import java.util.Calendar;
257 Calendar cal = new GregorianCalendar(1999, Calendar.JUNE, 2, 15, 3, 6); in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
261 assertFormat(format, " G", new GregorianCalendar(-1999, Calendar.JUNE, 2), " BC", in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
268 assertFormat(format, " yy", new GregorianCalendar(2001, Calendar.JUNE, 2), " 01", in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
270 assertFormat(format, " yy", new GregorianCalendar(2000, Calendar.JUNE, 2), " 00", in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
272 assertFormat(format, " yyy", new GregorianCalendar(2000, Calendar.JUNE, 2), " 2000", in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
279 assertFormat(format, " M", new GregorianCalendar(1999, Calendar.NOVEMBER, 2), " 11", in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
287 assertFormat(format, " d", new GregorianCalendar(1999, Calendar.NOVEMBER, 12), " 12", in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
293 assertFormat(format, " h", new GregorianCalendar(1999, Calendar.NOVEMBER, 12), " 12", in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
299 assertFormat(format, " H", new GregorianCalendar(1999, Calendar.NOVEMBER, 12, 4, 0), " 4", in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
[all …]
/libcore/luni/src/test/java/libcore/java/sql/
DOldResultSetGetterTests.java32 import java.util.Calendar;
411 GregorianCalendar testCal = new GregorianCalendar(1799, Calendar.MAY, 26, 0, 0); in testGetDateInt()
431 GregorianCalendar testCal = new GregorianCalendar(1799, Calendar.MAY, 26, 0, 0); in testGetDateIntCalendar()
453 GregorianCalendar testCal = new GregorianCalendar(1799, Calendar.MAY, 26, 0, 0); in testGetDateString()
473 GregorianCalendar testCal = new GregorianCalendar(1799, Calendar.MAY, 26, 0, 0); in testGetDateStringCalendar()
926 Calendar cal = new GregorianCalendar(); in testGetTimeInt()
928 cal.set(Calendar.HOUR_OF_DAY, 12); in testGetTimeInt()
929 cal.set(Calendar.MINUTE, 35); in testGetTimeInt()
930 cal.set(Calendar.SECOND, 45); in testGetTimeInt()
931 cal.set(Calendar.MILLISECOND, 0); in testGetTimeInt()
[all …]
/libcore/ojluni/src/test/java/time/test/java/time/chrono/
DTestThaiBuddhistChronoImpl.java66 import java.util.Calendar;
97 Calendar cal = java.util.Calendar.getInstance(locale); in test_ThaiBuddhistChrono_vsCalendar()
103 cal.set(Calendar.YEAR, thaiDate.get(ChronoField.YEAR)); in test_ThaiBuddhistChrono_vsCalendar()
104 cal.set(Calendar.MONTH, thaiDate.get(ChronoField.MONTH_OF_YEAR) - 1); in test_ThaiBuddhistChrono_vsCalendar()
105 cal.set(Calendar.DAY_OF_MONTH, thaiDate.get(ChronoField.DAY_OF_MONTH)); in test_ThaiBuddhistChrono_vsCalendar()
108 …assertEquals(thaiDate.get(ChronoField.DAY_OF_MONTH), cal.get(Calendar.DAY_OF_MONTH), "Day mismatch… in test_ThaiBuddhistChrono_vsCalendar()
109 …assertEquals(thaiDate.get(ChronoField.MONTH_OF_YEAR), cal.get(Calendar.MONTH) + 1, "Month mismatch… in test_ThaiBuddhistChrono_vsCalendar()
110 …assertEquals(thaiDate.get(ChronoField.YEAR_OF_ERA), cal.get(Calendar.YEAR), "Year mismatch in " + … in test_ThaiBuddhistChrono_vsCalendar()
113 cal.add(Calendar.DAY_OF_MONTH, 1); in test_ThaiBuddhistChrono_vsCalendar()
117 private String calToString(Calendar cal) { in calToString()
[all …]
DTestIsoChronoImpl.java70 import java.util.Calendar;
100 cal.set(Calendar.YEAR, isoDate.get(YEAR)); in test_IsoChrono_vsCalendar()
101 cal.set(Calendar.MONTH, isoDate.get(MONTH_OF_YEAR) - 1); in test_IsoChrono_vsCalendar()
102 cal.set(Calendar.DAY_OF_MONTH, isoDate.get(DAY_OF_MONTH)); in test_IsoChrono_vsCalendar()
105 …assertEquals(isoDate.get(DAY_OF_MONTH), cal.get(Calendar.DAY_OF_MONTH), "Day mismatch in " + isoDa… in test_IsoChrono_vsCalendar()
106 …assertEquals(isoDate.get(MONTH_OF_YEAR), cal.get(Calendar.MONTH) + 1, "Month mismatch in " + isoDa… in test_IsoChrono_vsCalendar()
107 … assertEquals(isoDate.get(YEAR_OF_ERA), cal.get(Calendar.YEAR), "Year mismatch in " + isoDate); in test_IsoChrono_vsCalendar()
110 cal.add(Calendar.DAY_OF_MONTH, 1); in test_IsoChrono_vsCalendar()
131 cal.set(Calendar.YEAR, isoDate.get(YEAR)); in test_DayOfWeek_IsoChronology_vsCalendar()
132 cal.set(Calendar.MONTH, isoDate.get(MONTH_OF_YEAR) - 1); in test_DayOfWeek_IsoChronology_vsCalendar()
[all …]
DTestJapaneseChronoImpl.java70 import java.util.Calendar;
102 Calendar cal = Calendar.getJapaneseImperialInstance(TimeZone.getDefault(), locale); in test_JapaneseChrono_vsCalendar()
114 …assertEquals(jDate.get(ChronoField.DAY_OF_MONTH), cal.get(Calendar.DAY_OF_MONTH), "Day mismatch in… in test_JapaneseChrono_vsCalendar()
115 …assertEquals(jDate.get(ChronoField.MONTH_OF_YEAR), cal.get(Calendar.MONTH) + 1, "Month mismatch in… in test_JapaneseChrono_vsCalendar()
116 …assertEquals(jDate.get(ChronoField.YEAR_OF_ERA), cal.get(Calendar.YEAR), "Year mismatch in " + jDa… in test_JapaneseChrono_vsCalendar()
119 cal.add(Calendar.DAY_OF_MONTH, 1); in test_JapaneseChrono_vsCalendar()
130 Calendar cal = java.util.Calendar.getInstance(locale); in test_dayOfYearVsCalendar()
140 assertEquals(jd.get(ChronoField.DAY_OF_YEAR), cal.get(Calendar.DAY_OF_YEAR), in test_dayOfYearVsCalendar()
142 …tEquals(jd.range(ChronoField.DAY_OF_YEAR).getMaximum(), cal.getActualMaximum(Calendar.DAY_OF_YEAR), in test_dayOfYearVsCalendar()
144 …tEquals(jd.range(ChronoField.DAY_OF_YEAR).getMinimum(), cal.getActualMinimum(Calendar.DAY_OF_YEAR), in test_dayOfYearVsCalendar()
/libcore/ojluni/src/main/java/sun/util/locale/provider/
DCalendarDataUtility.java31 import static java.util.Calendar.*;
33 import java.util.Calendar;
61 if (field == Calendar.ERA) { in retrieveFieldValueName()
123 if (field == Calendar.ERA) { in retrieveFieldValueNamesImpl()
165 case Calendar.MONTH: in getNames()
167 case Calendar.ERA: in getNames()
178 case Calendar.DAY_OF_WEEK: in getNames()
180 case Calendar.AM_PM: in getNames()
197 case Calendar.SHORT_FORMAT: in toWidth()
198 case Calendar.SHORT_STANDALONE: in toWidth()
[all …]
/libcore/ojluni/src/main/java/java/time/format/
DTextStyle.java64 import java.util.Calendar;
94 FULL(Calendar.LONG_FORMAT, 0),
99 FULL_STANDALONE(Calendar.LONG_STANDALONE, 0),
104 SHORT(Calendar.SHORT_FORMAT, 1),
109 SHORT_STANDALONE(Calendar.SHORT_STANDALONE, 1),
114 NARROW(Calendar.NARROW_FORMAT, 1),
119 NARROW_STANDALONE(Calendar.NARROW_STANDALONE, 1);
DDateTimeTextProvider.java81 import java.util.Calendar;
174 fieldIndex = Calendar.ERA; in getText()
185 fieldIndex = Calendar.MONTH; in getText()
188 fieldIndex = Calendar.DAY_OF_WEEK; in getText()
191 fieldValue = Calendar.SUNDAY; in getText()
194 fieldIndex = Calendar.AM_PM; in getText()
254 fieldIndex = Calendar.ERA; in getTextIterator()
257 fieldIndex = Calendar.MONTH; in getTextIterator()
260 fieldIndex = Calendar.DAY_OF_WEEK; in getTextIterator()
263 fieldIndex = Calendar.AM_PM; in getTextIterator()
[all …]
/libcore/luni/src/test/java/libcore/icu/
DRelativeDateTimeFormatterTest.java19 import java.util.Calendar;
43 Calendar cal = Calendar.getInstance(tz, en_US); in test_getRelativeTimeSpanStringCTS()
45 cal.set(2015, Calendar.FEBRUARY, 5, 10, 50, 0); in test_getRelativeTimeSpanStringCTS()
99 Calendar cal = Calendar.getInstance(tz, en_US); in test_getRelativeTimeSpanString_helper()
101 cal.set(2015, Calendar.FEBRUARY, 5, 10, 50, 0); in test_getRelativeTimeSpanString_helper()
356 Calendar cal = Calendar.getInstance(tz, de_DE); in test_getRelativeTimeSpanStringGerman()
358 cal.set(2015, Calendar.FEBRUARY, 5, 10, 50, 0); in test_getRelativeTimeSpanStringGerman()
384 Calendar cal = Calendar.getInstance(tz, fr_FR); in test_getRelativeTimeSpanStringFrench()
386 cal.set(2015, Calendar.FEBRUARY, 5, 10, 50, 0); in test_getRelativeTimeSpanStringFrench()
424 Calendar cal = Calendar.getInstance(tz, en_US); in test_getRelativeDateTimeString()
[all …]
DDateIntervalFormatTest.java19 import android.icu.util.Calendar;
37 Calendar c = Calendar.getInstance(tz, ULocale.US); in test_formatDateInterval()
38 c.set(Calendar.MONTH, Calendar.JANUARY); in test_formatDateInterval()
39 c.set(Calendar.DAY_OF_MONTH, 19); in test_formatDateInterval()
40 c.set(Calendar.HOUR_OF_DAY, 3); in test_formatDateInterval()
41 c.set(Calendar.MINUTE, 30); in test_formatDateInterval()
42 c.set(Calendar.SECOND, 15); in test_formatDateInterval()
43 c.set(Calendar.MILLISECOND, 0); in test_formatDateInterval()
46 c.set(Calendar.YEAR, 2009); in test_formatDateInterval()
49 c.set(Calendar.MINUTE, 0); in test_formatDateInterval()
[all …]
/libcore/luni/src/test/java/libcore/java/text/
DSimpleDateFormatTest.java24 import java.util.Calendar;
89 … assertEquals(Calendar.JUNE, parseDateUtc(en, "yyyy-MMMM-dd", "1980-June-12").get(Calendar.MONTH)); in testStandAloneNames()
90 … assertEquals(Calendar.JUNE, parseDateUtc(en, "yyyy-LLLL-dd", "1980-June-12").get(Calendar.MONTH)); in testStandAloneNames()
91 …assertEquals(Calendar.JUNE, parseDateUtc(pl, "yyyy-MMMM-dd", "1980-czerwca-12").get(Calendar.MONTH… in testStandAloneNames()
92 …assertEquals(Calendar.JUNE, parseDateUtc(pl, "yyyy-LLLL-dd", "1980-czerwiec-12").get(Calendar.MONT… in testStandAloneNames()
94 … assertEquals(Calendar.TUESDAY, parseDateUtc(en, "EEEE", "Tuesday").get(Calendar.DAY_OF_WEEK)); in testStandAloneNames()
95 … assertEquals(Calendar.TUESDAY, parseDateUtc(en, "cccc", "Tuesday").get(Calendar.DAY_OF_WEEK)); in testStandAloneNames()
96 …assertEquals(Calendar.TUESDAY, parseDateUtc(ru, "EEEE", "\u0432\u0442\u043e\u0440\u043d\u0438\u043… in testStandAloneNames()
97 …assertEquals(Calendar.TUESDAY, parseDateUtc(ru, "cccc", "\u0412\u0442\u043e\u0440\u043d\u0438\u043… in testStandAloneNames()
223 private static Calendar parseDateUtc(Locale l, String fmt, String value) { in parseDateUtc()
[all …]
/libcore/ojluni/src/main/java/java/text/
DDateFormat.java43 import java.util.Calendar;
160 protected Calendar calendar;
639 public void setCalendar(Calendar newCalendar) in setCalendar()
649 public Calendar getCalendar() in getCalendar()
774 other.calendar = (Calendar) calendar.clone(); in clone()
841 new Field[Calendar.FIELD_COUNT];
931 public final static Field ERA = new Field("era", Calendar.ERA);
936 public final static Field YEAR = new Field("year", Calendar.YEAR);
941 public final static Field MONTH = new Field("month", Calendar.MONTH);
947 Field("day of month", Calendar.DAY_OF_MONTH);
[all …]

1234