List of usage examples for org.apache.commons.lang.time DateUtils RANGE_WEEK_RELATIVE
int RANGE_WEEK_RELATIVE
To view the source code for org.apache.commons.lang.time DateUtils RANGE_WEEK_RELATIVE.
Click Source Link
From source file:org.kuali.kra.committee.web.CommitteeScheduleAddSeleniumTest.java
/** * Gets the next Monday date occurring after the given {@code startDate}. * //from ww w. ja v a2 s . co m * @param startDate the date to start at * @return the next Monday date occurring after the given {@code startDate} */ @SuppressWarnings("unchecked") private Date getMonday(Date startDate) { Date monday = startDate; for (Iterator<Calendar> iter = DateUtils.iterator(startDate, DateUtils.RANGE_WEEK_RELATIVE); iter .hasNext();) { Calendar calendar = iter.next(); if (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.MONDAY) { monday = calendar.getTime(); break; } } return monday; }