daysInMonth property

  1. @useResult
int get daysInMonth

The number of days in the month, taking leap years into account.

DateTime(2019, 2).daysInMonth; // 28
DateTime(2020, 2).daysInMonth; // 29

Implementation

@useResult int get daysInMonth => Dates.daysInMonth(year, month);