calculateDayRange static method
List<int>
calculateDayRange(
{ - required DateTime minDateTime,
- required DateTime maxDateTime,
- required int? currentYear,
- required int? currentMonth,
})
Implementation
static List<int> calculateDayRange(
{
required DateTime minDateTime,
required DateTime maxDateTime,
required int? currentYear,
required int? currentMonth,
}
) {
int minDay = 1, maxDay = _calculateDayCountOfMonth(currentMonth, currentYear);
int minYear = minDateTime.year;
int maxYear = maxDateTime.year;
int minMonth = minDateTime.month;
int maxMonth = maxDateTime.month;
if (minYear == currentYear && minMonth == currentMonth) {
minDay = minDateTime.day;
}
if (maxYear == currentYear && maxMonth == currentMonth) {
maxDay = maxDateTime.day;
}
return [minDay, maxDay];
}