@Test public void testDateTimeFields() { CalendarDate cd; try { cd = CalendarDate.of(null, 1,1,1,1,1,1); } catch (Exception e) { assert false; } try { cd = CalendarDate.of(null, 1,0,1,1,1,1); } catch (Exception e) { System.out.printf("%s%n", e.getMessage()); assert true; } try { cd = CalendarDate.of(null, 1,1,0,1,1,1); } catch (Exception e) { System.out.printf("%s%n", e.getMessage()); assert true; } cd = CalendarDate.of(null, 1,1,1,0,1,1); cd = CalendarDate.of(null, 1,1,1,1,0,1); cd = CalendarDate.of(null, 1,1,1,1,1,0); }
public static CalendarDate of(Calendar cal, int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute) { Chronology base = Calendar.getChronology(cal); DateTime dt = new DateTime(year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour, secondOfMinute, base); if (!Calendar.isDefaultChronology(cal)) dt = dt.withChronology(Calendar.getChronology(cal)); dt = dt.withZone(DateTimeZone.UTC); return new CalendarDate(cal, dt); }
CalendarDate implements Comparable<CalendarDate> { public static CalendarDate of(Calendar cal, int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute) { Chronology base = Calendar.getChronology(cal); DateTime dt = new DateTime(year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour, secondOfMinute, base); if (!Calendar.isDefaultChronology(cal)) dt = dt.withChronology(Calendar.getChronology(cal)); dt = dt.withZone(DateTimeZone.UTC); return new CalendarDate(cal, dt); } }
CalendarDate implements Comparable<CalendarDate> { public static CalendarDate of(Calendar cal, int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute) { Chronology base = Calendar.getChronology(cal); DateTime dt = new DateTime(year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour, secondOfMinute, base); if (!Calendar.isDefaultChronology(cal)) dt = dt.withChronology(Calendar.getChronology(cal)); dt = dt.withZone(DateTimeZone.UTC); return new CalendarDate(cal, dt); } CalendarDate(Calendar cal, DateTime dateTime); }
CalendarDate implements Comparable<CalendarDate> { public static CalendarDate of(Calendar cal, int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute) { Chronology base = Calendar.getChronology(cal); DateTime dt = new DateTime(year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour, secondOfMinute, base); if (!Calendar.isDefaultChronology(cal)) dt = dt.withChronology(Calendar.getChronology(cal)); dt = dt.withZone(DateTimeZone.UTC); return new CalendarDate(cal, dt); } CalendarDate(Calendar cal, DateTime dateTime); static CalendarDate present(); static CalendarDate of(Calendar cal, int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute); static CalendarDate withDoy(Calendar cal, int year, int doy, int hourOfDay, int minuteOfHour, int secondOfMinute); static CalendarDate of(java.util.Date date); static CalendarDate of(long msecs); static CalendarDate of(Calendar cal, long msecs); static CalendarDate parseISOformat(String calendarName, String isoDateString); static CalendarDate parseISOformatOld(String calendarName, String isoDateString); static CalendarDate parseUdunits(String calendarName, String udunits); Calendar getCalendar(); long getMillis(); @Override int compareTo(CalendarDate o); boolean isAfter( CalendarDate o); boolean isBefore( CalendarDate o); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); int getHourOfDay(); CalendarDate add(double value, CalendarPeriod.Field unit); CalendarDate add(CalendarPeriod period); CalendarDate subtract(CalendarPeriod period); java.util.Date toDate(); long getDifferenceInMsecs(CalendarDate o); static void main(String[] args); }
CalendarDate implements Comparable<CalendarDate> { public static CalendarDate of(Calendar cal, int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute) { Chronology base = Calendar.getChronology(cal); DateTime dt = new DateTime(year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour, secondOfMinute, base); if (!Calendar.isDefaultChronology(cal)) dt = dt.withChronology(Calendar.getChronology(cal)); dt = dt.withZone(DateTimeZone.UTC); return new CalendarDate(cal, dt); } CalendarDate(Calendar cal, DateTime dateTime); static CalendarDate present(); static CalendarDate of(Calendar cal, int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute); static CalendarDate withDoy(Calendar cal, int year, int doy, int hourOfDay, int minuteOfHour, int secondOfMinute); static CalendarDate of(java.util.Date date); static CalendarDate of(long msecs); static CalendarDate of(Calendar cal, long msecs); static CalendarDate parseISOformat(String calendarName, String isoDateString); static CalendarDate parseISOformatOld(String calendarName, String isoDateString); static CalendarDate parseUdunits(String calendarName, String udunits); Calendar getCalendar(); long getMillis(); @Override int compareTo(CalendarDate o); boolean isAfter( CalendarDate o); boolean isBefore( CalendarDate o); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); int getHourOfDay(); CalendarDate add(double value, CalendarPeriod.Field unit); CalendarDate add(CalendarPeriod period); CalendarDate subtract(CalendarPeriod period); java.util.Date toDate(); long getDifferenceInMsecs(CalendarDate o); static void main(String[] args);  }