roundToLastDayOfMonth static method

DateTime roundToLastDayOfMonth(
  1. DateTime date
)

Rounds the given DateTime to the last day of the month.

Implementation

static DateTime roundToLastDayOfMonth(DateTime date) {
  final daysInMonth = getDaysCountInMonth(date.year, date.month);
  return DateTime(date.year, date.month, daysInMonth);
}