operator - method

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

Returns a copy of this with other subtracted.

No normalization is performed.

Period(years: 1, months: 1) - Period(months: 12); // 1 year -11 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,
);