List of utility methods to do Week Calculate
int | weekCount(Date start, Date end) week Count final Calendar startCalendar = Calendar.getInstance(); startCalendar.setTime(start); final Calendar endCalendar = Calendar.getInstance(); endCalendar.setTime(end); final int startWeekofYear = startCalendar.get(Calendar.WEEK_OF_YEAR); final int endWeekofYear = endCalendar.get(Calendar.WEEK_OF_YEAR); int count = endWeekofYear - startWeekofYear + 1; if (Calendar.SUNDAY != startCalendar.get(Calendar.DAY_OF_WEEK)) { ... |
int | weekNumber() week Number return weekNumber(new GregorianCalendar()); |
int | weeksInYear(int year) weeks In Year Calendar c = Calendar.getInstance();
c.set(Calendar.YEAR, year);
return c.getActualMaximum(Calendar.WEEK_OF_YEAR);
|
GregorianCalendar | weekStart() week Start return weekStart(new GregorianCalendar()); |