lastDayOfMonth property

  1. @useResult
DateTime get lastDayOfMonth

The last day of the month.

DateTime(2023, 4, 11).lastDayOfMonth; // 2023-04-30

Implementation

@useResult DateTime get lastDayOfMonth => copyWith(day: daysInMonth, hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0);