getDaysInMouth static method
返回当前月份的自然月天数
Implementation
static int getDaysInMouth({DateTime? dateTime, int? year, int? month}) {
if (dateTime == null && (year == null || month == null)) {
return 30;
}
return DateTime(year ?? dateTime!.year, (month ?? dateTime!.month) + 1, 1)
.add(const Duration(days: -1))
.day;
}