getDayOfYear method
在今年的第几天.
Implementation
int getDayOfYear() {
var dateTime = this;
if (dateTime == null) {
return 0;
}
int year = dateTime.year;
int month = dateTime.month;
int days = dateTime.day;
for (int i = 1; i < month; i++) {
days = days + (_monthDay[i] ?? 0);
}
if (DateUtils.isLeapYear(year) && month > 2) {
days = days + 1;
}
return days;
}