List of utility methods to do Week End
Date | getFirstDayOfWeek(Date date) get First Day Of Week Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
return getADayOfWeek(calendar, Calendar.MONDAY).getTime();
|
Date | getFirstDayOfWeek(Date date) get First Day Of Week Calendar c = new GregorianCalendar(); c.setFirstDayOfWeek(Calendar.MONDAY); c.setTime(date); c.set(Calendar.DAY_OF_WEEK, c.getFirstDayOfWeek()); return c.getTime(); |
Date | getFirstDayOfWeek(Date date) get First Day Of Week Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.SUNDAY);
calendar.setTime(date);
calendar.set(Calendar.DAY_OF_WEEK, calendar.getFirstDayOfWeek());
return calendar.getTime();
|
Date | getFirstDayOfWeek(Date date) get First Day Of Week Calendar c = new GregorianCalendar(); c.setFirstDayOfWeek(Calendar.MONDAY); c.setTime(date); c.set(Calendar.DAY_OF_WEEK, c.getFirstDayOfWeek()); return c.getTime(); |
Date | getFirstDayOfWeekFromMonday(Date now) get First Day Of Week From Monday Calendar cal = Calendar.getInstance();
cal.setTime(now);
cal.setFirstDayOfWeek(Calendar.MONDAY);
cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
return cal.getTime();
|