subtract method
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,
})
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();
}