List of utility methods to do Week Day
String | getFirstDayOfWeek(String str, int week) get First Day Of Week String conStr = null; int dayOfWeek = 0; if (week == 0) { conStr = str; dayOfWeek = getCalendar(conStr).get(Calendar.DAY_OF_WEEK); } else { conStr = addDays(str, week * 7); dayOfWeek = getCalendar(conStr).get(Calendar.DAY_OF_WEEK); ... |
String | getFirstDayOfWeek(String week) get First Day Of Week try { return getDefaultDateFormat().format(getDefaultWeekFormat().parse(week)); } catch (ParseException e) { return "ERROR_DAY"; |
String | getFirstDayOfWeek(String week) get First Day Of Week try { return getDefaultDateFormat().format(getDefaultWeekFormat().parse(week)); } catch (ParseException e) { return "ERROR_DAY"; |
String | getFriday(Date date) get Friday Calendar c = Calendar.getInstance(); c.setTime(date); c.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY); return new SimpleDateFormat("yyyy-MM-dd").format(c.getTime()); |
Date | getLastDayOfCurrWeek() get Last Day Of Curr Week Calendar c = new GregorianCalendar(); c.set(Calendar.DAY_OF_WEEK, c.getFirstDayOfWeek() + 6); c.set(Calendar.MILLISECOND, 999); c.set(Calendar.SECOND, 59); c.set(Calendar.MINUTE, 59); c.set(Calendar.HOUR_OF_DAY, 23); return c.getTime(); |
int | getLastDayOfWeek(int year, int month) get Last Day Of Week Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, year);
calendar.set(Calendar.MONTH, month);
calendar.set(Calendar.DATE, 0);
return calendar.get(Calendar.WEEK_OF_MONTH);
|
String | getLastSundayBeforeThisWeek() get Last Sunday Before This Week Calendar c = Calendar.getInstance(); int dayOfWeek = c.get(Calendar.DAY_OF_WEEK) - 1; if (dayOfWeek == 0) { dayOfWeek = 7; c.add(Calendar.DATE, -dayOfWeek); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); return sdf.format(c.getTime()); ... |
Calendar | getLastWeekday() get Last Weekday return getLastWeekday(getYesterday());
|
Date | getLastWeekDay(int weekDay) get Last Week Day return getLastWeekDay(weekDay, new Date()); |
Date | getLastWeekDay(int weekDay) Get the last date in the specified week day counted from today. return getLastWeekDay(weekDay, new Date()); |