public static boolean checkIfb4June2015(String month) { Calendar ret = Calendar.getInstance(); GeneralHelpers.setDateByString(ret, ConstantsTruthy.b4BigIntMonth); long june2015 = ret.getTimeInMillis(); GeneralHelpers.setDateByString(ret, month); long currentMonth = ret.getTimeInMillis(); return (currentMonth > june2015); }
/** * Set start and end calendars of an interval by their string representations. * * @param calStart * @param calEnd * @param startTime * @param endTime */ public static void setStartAndEndCalendar( Calendar calStart, Calendar calEnd, String startTime, String endTime) { if (startTime.indexOf('T') >= 0) { GeneralHelpers.setDateTimeByString(calStart, startTime); } else { GeneralHelpers.setDateByString(calStart, startTime); } if (endTime.indexOf('T') >= 0) { GeneralHelpers.setDateTimeByString(calEnd, endTime); calEnd.set(Calendar.MILLISECOND, 999); } else { GeneralHelpers.setDateByString(calEnd, endTime); calEnd.set(Calendar.HOUR_OF_DAY, 23); calEnd.set(Calendar.MINUTE, 59); calEnd.set(Calendar.SECOND, 59); calEnd.set(Calendar.MILLISECOND, 999); } }