Brought in another asset for Ray's eye form: moment
[openemr.git] / public / assets / moment-2-13-0 / src / lib / duration / add-subtract.js
blob3b44e186fcc21a21444698fa41690b172a6be18c
1 import { createDuration } from './create';
3 function addSubtract (duration, input, value, direction) {
4     var other = createDuration(input, value);
6     duration._milliseconds += direction * other._milliseconds;
7     duration._days         += direction * other._days;
8     duration._months       += direction * other._months;
10     return duration._bubble();
13 // supports only 2.0-style add(1, 's') or add(duration)
14 export function add (input, value) {
15     return addSubtract(this, input, value, 1);
18 // supports only 2.0-style subtract(1, 's') or subtract(duration)
19 export function subtract (input, value) {
20     return addSubtract(this, input, value, -1);