daysUntilWeekend method

int daysUntilWeekend()

Return days until the weekend. If the date is in the weekend, the result will be 0.

Implementation

int daysUntilWeekend() {
  if (isWeekend) {
    return 0;
  } else {
    return DateTime.saturday - weekday;
  }
}