totalDayInYear static method
Get total day of year
final result = GlobalFunction.totalDayInYear(2020)
print(result) // 366
https://www.epochconverter.com/days/2020
Implementation
static int totalDayInYear(int year) {
var tempTotalDayInYear = 0;
const totalMonthInYear = 12;
for (int i = 1; i <= totalMonthInYear; i++) {
final totalDay = totalDaysOfMonth(year: year, month: i);
tempTotalDayInYear += totalDay;
}
return tempTotalDayInYear;
}