dayOfYear method

dynamic dayOfYear([
  1. int? val
])

Implementation

dynamic dayOfYear([int? val]) {
  final firstTimeOfYear = clone()
    ..setMonth(1)
    ..setDate(0)
    ..finished();

  if (val == null) {
    return diff(firstTimeOfYear, 'd');
  } else {
    return firstTimeOfYear.add(val, 'd');
  }
}