dayOfYear method

int dayOfYear ()

Returns the number of days in this year e.g.: February 1st = 32.

Implementation

int dayOfYear() {
  List<int> _daysInYear = <int>[
    0,
    0,
    31,
    59,
    90,
    120,
    151,
    181,
    212,
    243,
    273,
    304,
    334
  ];
  int doy = _daysInYear[month] + day;
  if (isInLeapYear() && (month > 2)) {
    doy++;
  }
  return doy;
}