countWeeks function

String countWeeks(
  1. int difference
)

Implementation

String countWeeks(int difference) {
  int count = (difference / 604800000).truncate();
  if (count > 3) {
    return "one month";
  }
  return count.toString() + (count > 1 ? ' weeks' : ' week');
}