Java Utililty Methods Week End

List of utility methods to do Week End

Description

The list of methods to do Week End are organized into topic(s).

Method

DategetFirstDayOfWeek(Date date)
get First Day Of Week
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
return getADayOfWeek(calendar, Calendar.MONDAY).getTime();
DategetFirstDayOfWeek(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();
DategetFirstDayOfWeek(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();
DategetFirstDayOfWeek(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();
DategetFirstDayOfWeekFromMonday(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();