(base, other)
| 3541 | } |
| 3542 | |
| 3543 | function momentsDifference(base, other) { |
| 3544 | var res; |
| 3545 | if (!(base.isValid() && other.isValid())) { |
| 3546 | return { milliseconds: 0, months: 0 }; |
| 3547 | } |
| 3548 | |
| 3549 | other = cloneWithOffset(other, base); |
| 3550 | if (base.isBefore(other)) { |
| 3551 | res = positiveMomentsDifference(base, other); |
| 3552 | } else { |
| 3553 | res = positiveMomentsDifference(other, base); |
| 3554 | res.milliseconds = -res.milliseconds; |
| 3555 | res.months = -res.months; |
| 3556 | } |
| 3557 | |
| 3558 | return res; |
| 3559 | } |
| 3560 | |
| 3561 | // TODO: remove 'name' arg after deprecation is removed |
| 3562 | function createAdder(direction, name) { |
no test coverage detected