daysInMonth method

int daysInMonth ()

Returns the number of days in the month.

Implementation

int daysInMonth() {
  if (isInLeapYear() && (month == 2)) {
    return 29;
  }
  List<int> _daysPerMonth = <int>[
    0,
    31,
    28,
    31,
    30,
    31,
    30,
    31,
    31,
    30,
    31,
    30,
    31
  ];
  return _daysPerMonth[month];
}