operator + method

  1. @useResult
Period operator +(
  1. Period other
)

Returns the sum of this and other.

No normalization is performed.

Period(years: 1, months: 1) + Period(months: 12); // 1 year 13 months

Implementation

@useResult Period operator + (Period other) => Period(
  years: years + other.years,
  months: months + other.months,
  days: days + other.days,
  hours: hours + other.hours,
  minutes: minutes + other.minutes,
  seconds: seconds + other.seconds,
  milliseconds: milliseconds + other.milliseconds,
  microseconds: microseconds + other.microseconds,
);