List of utility methods to do Week Day
void | addMonthToFirstDayOfWeek(Calendar c, int dayOfWeek, int monthInterval) add Month To First Day Of Week addMonthToDayOfMonth(c, 1, monthInterval); toDayOfWeekInMonth(c, dayOfWeek, 1); |
Date | calculateFloatingHoliday(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; ... |
int | dayOfWeek() day Of Week GregorianCalendar g = new GregorianCalendar(); int ret = g.get(java.util.Calendar.DAY_OF_WEEK); g = null; return ret; |
int | dayOfWeek(Date pWallDate) day Of Week return pWallDate.getDay();
|
int | dayOfWeek(final Date date) day Of Week Calendar calendar = GregorianCalendar.getInstance(); calendar.setTime(date); int weekday = calendar.get(Calendar.DAY_OF_WEEK); return weekday; |
int | dayOfWeek(String pFormerStr) day Of Week GregorianCalendar vTodayCal = parse2Cal(pFormerStr);
return vTodayCal.get(7);
|
void | dayOfWeekFix(Calendar calendar) wtf is this?? calendar.add(Calendar.DATE, 1); calendar.add(Calendar.DATE, -1); |
int | dayOfWeekRus(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; |
int | firstDayOfWeek(int year, int month) first Day Of Week Date firstDate = new Date(year - 1900, month - 1, 1); return firstDate.getDay(); |
Date | getAPastDayOfTheWeek(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; ... |