Java Utililty Methods Week Day

List of utility methods to do Week Day

Description

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

Method

voidaddMonthToFirstDayOfWeek(Calendar c, int dayOfWeek, int monthInterval)
add Month To First Day Of Week
addMonthToDayOfMonth(c, 1, monthInterval);
toDayOfWeekInMonth(c, dayOfWeek, 1);
DatecalculateFloatingHoliday(int nth, int dayOfWeek, int year, int month)
This method will take in the various parameters and return a Date object that represents that value.
Calendar baseCal = Calendar.getInstance();
baseCal.clear();
baseCal.set(year, month, 1);
if (nth <= 0)
    baseCal.add(Calendar.MONTH, 1);
Date baseDate = baseCal.getTime();
int baseDayOfWeek = baseCal.get(Calendar.DAY_OF_WEEK);
int fwd = dayOfWeek - baseDayOfWeek;
...
intdayOfWeek()
day Of Week
GregorianCalendar g = new GregorianCalendar();
int ret = g.get(java.util.Calendar.DAY_OF_WEEK);
g = null;
return ret;
intdayOfWeek(Date pWallDate)
day Of Week
return pWallDate.getDay();
intdayOfWeek(final Date date)
day Of Week
Calendar calendar = GregorianCalendar.getInstance();
calendar.setTime(date);
int weekday = calendar.get(Calendar.DAY_OF_WEEK);
return weekday;
intdayOfWeek(String pFormerStr)
day Of Week
GregorianCalendar vTodayCal = parse2Cal(pFormerStr);
return vTodayCal.get(7);
voiddayOfWeekFix(Calendar calendar)
wtf is this??
calendar.add(Calendar.DATE, 1);
calendar.add(Calendar.DATE, -1);
intdayOfWeekRus(Date d)
day Of Week Rus
Calendar date = new GregorianCalendar();
date.setTime(d);
int dow = date.get(Calendar.DAY_OF_WEEK);
dow = dow == 1 ? 7 : dow - 1;
return dow;
intfirstDayOfWeek(int year, int month)
first Day Of Week
Date firstDate = new Date(year - 1900, month - 1, 1);
return firstDate.getDay();
DategetAPastDayOfTheWeek(String dayToGet)
get A Past Day Of The Week
Calendar calendar = new GregorianCalendar();
switch (dayToGet) {
case "Monday":
    calendar.set(2015, Calendar.JUNE, 15);
    break;
case "Tuesday":
    calendar.set(2015, Calendar.JUNE, 16);
    break;
...