List of utility methods to do Calendar Compare
Calendar | min(final Calendar... calendars) min Vector<Calendar> list = new Vector<Calendar>(Arrays.asList(calendars)); Collections.sort(list); return list.firstElement(); |
Calendar | minCalendars(List Returns the minimum Calendar in the Calendar list. long min = Long.MAX_VALUE; Calendar minCalendar = null; for (Calendar value : calendars) { long v = value.getTimeInMillis(); if (v < min) { min = v; minCalendar = value; return minCalendar; |
Calendar | minimum(Calendar... calendars) Returns the smallest datetime from the given list. if (calendars == null || calendars.length == 0) return null; return minimum(Arrays.asList(calendars)); |