prevMonth function

DateTime prevMonth([
  1. DateTime? date
])

前一个月

Implementation

DateTime prevMonth([DateTime? date]) {
  final now = date ?? DateTime.now();
  final month = now.month - 1;
  final year = now.year;
  return DateTime(month < 1 ? year - 1 : year, month < 1 ? 12 : month);
}