calculateMonthRange static method
Implementation
static List<int> calculateMonthRange(
DateTime minDateTime,
DateTime maxDateTime,
int? currentYear
) {
int minMonth = 1, maxMonth = 12;
int minYear = minDateTime.year;
int maxYear = maxDateTime.year;
if (minYear == currentYear) {
minMonth = minDateTime.month;
}
if (maxYear == currentYear) {
maxMonth = maxDateTime.month;
}
return [minMonth, maxMonth];
}