subtract method

Jiffy subtract({
  1. Duration duration = Duration.zero,
  2. int years = 0,
  3. int months = 0,
  4. int weeks = 0,
  5. int days = 0,
  6. int hours = 0,
  7. int minutes = 0,
  8. int seconds = 0,
  9. int milliseconds = 0,
  10. int microseconds = 0,
})

Implementation

Jiffy subtract({
  Duration duration = Duration.zero,
  int years = 0,
  int months = 0,
  int weeks = 0,
  int days = 0,
  int hours = 0,
  int minutes = 0,
  int seconds = 0,
  int milliseconds = 0,
  int microseconds = 0,
}) {
  _dateTime = _dateTime.subtract(duration);
  _dateTime = _dateTime.subtract(Duration(
    days: days + weeks * 7,
    hours: hours,
    minutes: minutes,
    seconds: seconds,
    milliseconds: milliseconds,
    microseconds: microseconds,
  ));
  _dateTime = _addMonths(_dateTime, -months);
  _dateTime = _addMonths(_dateTime, -years * 12);
  return clone();
}