@Override public int compareTo(DtStamp o) { return getDate().compareTo(o.getDate()); }
@Override public int compareTo(DtStamp o) { return getDate().compareTo(o.getDate()); }
/** * @param arg0 another observance instance * @return a positve value if this observance starts earlier than the other, * a negative value if it occurs later than the other, or zero if they start * at the same time */ public final int compareTo(final Observance arg0) { // TODO: sort by RDATE?? final DtStart dtStart = (DtStart) getProperty(Property.DTSTART); final DtStart dtStart0 = (DtStart) arg0.getProperty(Property.DTSTART); return dtStart.getDate().compareTo(dtStart0.getDate()); }
private void checkDatesForComponent(Component component){ if(component == null){ return; } Property dtStart = component.getProperty(Property.DTSTART); Property dtEnd = component.getProperty(Property.DTEND); if( dtStart instanceof DtStart && dtStart.getValue()!= null && dtEnd instanceof DtEnd && dtEnd.getValue() != null && ((DtStart)dtStart).getDate().compareTo(((DtEnd)dtEnd).getDate()) > 0 ){ throw new IllegalArgumentException("End date [" + dtEnd + " is lower than start date [" + dtStart + "]"); } }
private void checkDatesForComponent(Component component){ if(component == null){ return; } Property dtStart = component.getProperty(Property.DTSTART); Property dtEnd = component.getProperty(Property.DTEND); if( dtStart instanceof DtStart && dtStart.getValue()!= null && dtEnd instanceof DtEnd && dtEnd.getValue() != null && ((DtStart)dtStart).getDate().compareTo(((DtEnd)dtEnd).getDate()) > 0 ){ throw new IllegalArgumentException("End date [" + dtEnd + " is lower than start date [" + dtStart + "]"); } }
/** * Compare Date instances using a timezone to pin floating Date and * DateTimes. * @param date1 The date. * @param date2 The date. * @param tz timezone to use when interpreting floating Date and DateTime * @return The result. */ public static int compareDates(Date date1, Date date2, TimeZone tz) { if(tz!=null) { if(isFloating(date1)) { date1 = pinFloatingTime(date1, tz); } if(isFloating(date2)) { date2 = pinFloatingTime(date2, tz); } } return date1.compareTo(date2); }
/** * Compare Date instances using a timezone to pin floating Date and * DateTimes. * @param date1 The date. * @param date2 The date. * @param tz timezone to use when interpreting floating Date and DateTime * @return The result. */ public static int compareDates(Date date1, Date date2, TimeZone tz) { if(tz!=null) { if(isFloating(date1)) { date1 = pinFloatingTime(date1, tz); } if(isFloating(date2)) { date2 = pinFloatingTime(date2, tz); } } return date1.compareTo(date2); }
public int compare(Calendar o1, Calendar o2) { VEvent e1 = ICalendarUtils.getFirstEvent(o1); VEvent e2 = ICalendarUtils.getFirstEvent(o2); return e1.getStartDate().getDate().compareTo(e2.getStartDate().getDate()); }
end = instance.getEnd(); if (start.compareTo(freeBusyRange.getStart()) < 0) { start = (DateTime) org.unitedinternet.cosmo.calendar.util.Dates.getInstance(freeBusyRange .getStart(), start); if (end.compareTo(freeBusyRange.getEnd()) > 0) { end = (DateTime) org.unitedinternet.cosmo.calendar.util.Dates.getInstance(freeBusyRange.getEnd(), end);
boolean timeShift = dtstart.compareTo(riddt) != 0; Dur offsetTime = timeShift ? new Dur(riddt, dtstart) : null; Dur newDuration = timeShift ? new Dur(dtstart, dtend) : null;
end = instance.getEnd(); if (start.compareTo(freeBusyRange.getStart()) < 0) { start = (DateTime) org.unitedinternet.cosmo.calendar.util.Dates.getInstance(freeBusyRange .getStart(), start); if (end.compareTo(freeBusyRange.getEnd()) > 0) { end = (DateTime) org.unitedinternet.cosmo.calendar.util.Dates.getInstance(freeBusyRange.getEnd(), end);
boolean timeShift = dtstart.compareTo(riddt) != 0; Dur offsetTime = timeShift ? new Dur(riddt, dtstart) : null; Dur newDuration = timeShift ? new Dur(dtstart, dtend) : null;