getDaysInMonth method

int getDaysInMonth(
  1. int year,
  2. int month
)

Returns the number of days in the given month within the given year.

  • year: The year in which to consider the month
  • month: The month to determine the number of days in

Returns: The number of days in the given month and year.

  • ArgumentOutOfRangeException: The given year / month combination is invalid for this calendar.

Implementation

int getDaysInMonth(int year, int month) {
  // Simplest way to validate the year and month. Assume it's quick enough to validate the day...
  _validateYearMonthDay(year, month, 1);
  return _yearMonthDayCalculator.getDaysInMonth(year, month);
}