List of utility methods to do Day in Month
String | toMonthFirstDay(String month) to Month First Day return month + "-01"; |
void | validateDayOfMonth(int day) validate Day Of Month if ((day < 1 || day > 31) && day != LAST_DAY_OF_MONTH) { throw new IllegalArgumentException("Invalid day of month."); |
void | validateMonthDay(int nDate) validate Month Day if ((nDate > 28) || (nDate < 1)) { throw new IndexOutOfBoundsException("nDate must be between 1 and 28. " + nDate + " was passed."); |
int | weekOfMonth(int dayCount, int commonMonthIndex) Answer the nth week of the given month int daysIntoMonth = dayCount - FirstDayOfMonth[commonMonthIndex - 1] + 1; return (daysIntoMonth / 7) + (((daysIntoMonth % 7) > 0) ? 1 : 0); |