MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / positiveMomentsDifference

Function positiveMomentsDifference

tests/test_code/js/moment/moment.js:3529–3541  ·  view source on GitHub ↗
(base, other)

Source from the content-addressed store, hash-verified

3527 }
3528
3529 function positiveMomentsDifference(base, other) {
3530 var res = {};
3531
3532 res.months =
3533 other.month() - base.month() + (other.year() - base.year()) * 12;
3534 if (base.clone().add(res.months, 'M').isAfter(other)) {
3535 --res.months;
3536 }
3537
3538 res.milliseconds = +other - +base.clone().add(res.months, 'M');
3539
3540 return res;
3541 }
3542
3543 function momentsDifference(base, other) {
3544 var res;

Callers 1

momentsDifferenceFunction · 0.85

Calls 1

addMethod · 0.45

Tested by

no test coverage detected