firstday function

DateTime firstday(
  1. DateTime d
)

Implementation

DateTime firstday(DateTime d) {
  String day1 =
      "${d.year.toString().padLeft(4, "0")}/${d.month.toString().padLeft(2, "0")}/01";

  return strToDate(day1);
}