List of utility methods to do Calendar Add
void | addDate(Calendar baseDate, int diffDate, TimeZone timezone) add Date baseDate.add(Calendar.DATE, diffDate); |
Date | addDate(Date date, int calendarField, int amount) add Date assertDateParamsRequired(date);
Calendar c = Calendar.getInstance();
c.setTime(date);
c.add(calendarField, amount);
return c.getTime();
|
Date | addDate(Date date, int calendarField, int numberToAdd) This method allows you to add to a java.util.Date returning a Date instead of void like the Calendar does Calendar c = Calendar.getInstance();
c.setTime(date);
c.add(calendarField, numberToAdd);
return c.getTime();
|
Calendar | addDayOffset(final Calendar date, long offset) add Day Offset Calendar newDate = new GregorianCalendar(); newDate.setTimeInMillis(date.getTimeInMillis()); newDate.add(Calendar.DAY_OF_MONTH, safeLongToInt(offset)); return newDate; |
void | addDays(Calendar aTarget, int aAddDays) add Days aTarget.add(Calendar.DATE, aAddDays); |
void | addDays(Calendar calendar, int days) Add the given amount of days to the given calendar. calendar.add(Calendar.DATE, days); |
Calendar | addDays(Calendar src, int days) add Days Calendar dest = deepCopy(src);
dest.add(Calendar.DATE, days);
return dest;
|
Date | addDays(final int days, final Calendar from) Add the given number of days to the given date return addDays(days, from.getTimeInMillis());
|
Calendar | addDayToCalendar(Calendar calendar, int day) add Day To Calendar calendar.add(Calendar.DAY_OF_MONTH, day);
return calendar;
|
Calendar | addLocaleToCalendar(Calendar date, String locale) add Locale To Calendar if (date != null) { if (locale != null) { Calendar localizedDate = Calendar.getInstance(new Locale(locale)); localizedDate.setTime(date.getTime()); return localizedDate; } else return date; return null; |