weekOfYear property

int weekOfYear

Implementation

int get weekOfYear {
  var from = DateTime.utc(this.year, 1, 1);
  from = from.subtract(Duration(days: from.weekday - 1));
  var to = DateTime.utc(this.year, this.month, this.day);
  to = to.subtract(Duration(days: to.weekday - 1));
  return (to.difference(from).inDays / 7).ceil();
}