firstDayOfMonth static method

DateTime firstDayOfMonth({
  1. int? month,
  2. int? year,
})

Implementation

static DateTime firstDayOfMonth({int? month, int? year}) {
  DateTime cal = DateTime.now();
  final firstDayOfMonth = DateTime.utc(year == null ? cal.year : year, month == null ? cal.month : month, 1);
  return firstDayOfMonth;
}