lastday function

DateTime lastday(
  1. DateTime d
)

Implementation

DateTime lastday(DateTime d) {
  int lastDay = getMonthDays(d.year, d.month);

  String dayLast =
      "${d.year.toString().padLeft(4, "0")}/${d.month.toString().padLeft(2, "0")}/${lastDay.toString().padLeft(2, "0")}";

  return strToDate(dayLast);
}