firstDayOfMonth static method

DateTime firstDayOfMonth({
  1. DateTime? date,
})

指定日期所在月的第一天

Implementation

static DateTime firstDayOfMonth({DateTime? date}) {
  if (date == null) date = DateTime.now();
  print('${date.toString()}');
  return DateTime(date.year, date.month);
}