add method

Moment add({
  1. int years = 0,
  2. int quarters = 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,
})

Adds time to the current date

Implementation

Moment add({
  int years: 0,
  int quarters: 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,
}) {
  var dateTime = DateTime(
    _date.year + years,
    _date.month + months + quarters * monthPerQuarter,
    _date.day + days + weeks * DateTime.daysPerWeek,
    _date.hour + hours,
    _date.minute + minutes,
    _date.second + seconds,
    _date.millisecond + milliseconds,
    _date.microsecond + microseconds,
  );
  return Moment.fromDateTime(dateTime);
}