function addOrSubtractDurationFromMoment(mom, duration, isAdding, ignoreUpdateOffset) {
        var milliseconds = duration._milliseconds,
            days = duration._days,
            months = duration._months,
            minutes,
            hours,
            currentDate;

        if (milliseconds) {
            mom._d.setTime(+mom._d + milliseconds * isAdding);
        }
        // store the minutes and hours so we can restore them
        if (days || months) {
            minutes = mom.minute();
            hours = mom.hour();
        }
        if (days) {
            mom.date(mom.date() + days * isAdding);
        }
        if (months) {
            mom.month(mom.month() + months * isAdding);
        }
        if (milliseconds && !ignoreUpdateOffset) {
            moment.updateOffset(mom);
        }
        // restore the minutes and hours after possibly changing dst
        if (days || months) {
            mom.minute(minutes);
            mom.hour(hours);
        }
    }
function addOrSubtractDurationFromMoment(mom, duration, isAdding, ignoreUpdateOffset) {
        var milliseconds = duration._milliseconds,
            days = duration._days,
            months = duration._months,
            minutes,
            hours,
            currentDate;

        if (milliseconds) {
            mom._d.setTime(+mom._d + milliseconds * isAdding);
        }
        
        if (days || months) {
            minutes = mom.minute();
            hours = mom.hour();
        }
        if (days) {
            mom.date(mom.date() + days * isAdding);
        }
        if (months) {
            mom.month(mom.month() + months * isAdding);
        }
        if (milliseconds && !ignoreUpdateOffset) {
            moment.updateOffset(mom);
        }
        
        if (days || months) {
            mom.minute(minutes);
            mom.hour(hours);
        }
    }
function addOrSubtractDurationFromMoment ( mom , duration , isAdding , ignoreUpdateOffset ) { var milliseconds = duration . _milliseconds , days = duration . _days , months = duration . _months , minutes , hours , currentDate ; if ( milliseconds ) { mom . _d . setTime ( + mom . _d + milliseconds * isAdding ) ; } // store the minutes and hours so we can restore them if ( days || months ) { minutes = mom . minute ( ) ; hours = mom . hour ( ) ; } if ( days ) { mom . date ( mom . date ( ) + days * isAdding ) ; } if ( months ) { mom . month ( mom . month ( ) + months * isAdding ) ; } if ( milliseconds && ! ignoreUpdateOffset ) { moment . updateOffset ( mom ) ; } // restore the minutes and hours after possibly changing dst if ( days || months ) { mom . minute ( minutes ) ; mom . hour ( hours ) ; } }
helper function for _.addTime and _.subtractTime
helper function for _ . addTime and _ . subtractTime