format(durationLike) {
    const formattedDurationList = [];
    const years = durationLike[DurationFormatUnit.YEAR];
    const months = durationLike[DurationFormatUnit.MONTH];
    const weeks = durationLike[DurationFormatUnit.WEEK];
    const days = durationLike[DurationFormatUnit.DAY];
    const hours = durationLike[DurationFormatUnit.HOUR];
    const minutes = durationLike[DurationFormatUnit.MINUTE];
    const seconds = durationLike[DurationFormatUnit.SECOND];
    if (years != null) {
      formattedDurationList.push(
          this.formatWithUnit_(years, DurationFormatUnit.YEAR));
    }

    if (months != null) {
      formattedDurationList.push(
          this.formatWithUnit_(months, DurationFormatUnit.MONTH));
    }

    if (weeks != null) {
      formattedDurationList.push(
          this.formatWithUnit_(weeks, DurationFormatUnit.WEEK));
    }

    if (days != null) {
      formattedDurationList.push(
          this.formatWithUnit_(days, DurationFormatUnit.DAY));
    }

    if (hours != null) {
      formattedDurationList.push(
          this.formatWithUnit_(hours, DurationFormatUnit.HOUR));
    }

    if (minutes != null) {
      formattedDurationList.push(
          this.formatWithUnit_(minutes, DurationFormatUnit.MINUTE));
    }

    if (seconds != null) {
      formattedDurationList.push(
          this.formatWithUnit_(seconds, DurationFormatUnit.SECOND));
    }

    // TODO(user): Add method for STYLE.DIGIT when available.
    const newListFormater = new ListFormat(
        {type: ListFormatType.UNIT, style: ListFormatStyle.NARROW});
    return newListFormater.format(formattedDurationList);
  }
Formats a string with the amount and correspondent unit.
@param {!DurationLike} durationLike  An object for the duration time whose
    keys can be one of DurationFormatUnit value.
@return {string} The formatted result.