utils/date.utils.js
function serializeAllDates(obj) {

        // if it is a date, then return serialized version
        if (_.isDate(obj)) {
            return serializeDate(obj);
        }

        // if array or object, loop over it
        if (_.isArray(obj) || _.isObject(obj)) {
            _.forEach(obj, function (item, key) {
                obj[key] = serializeAllDates(item);
            });
        }

        return obj;
    }
function serializeAllDates(obj) {

        // if it is a date, then return serialized version
        if (_.isDate(obj)) {
            return serializeDate(obj);
        }

        // if array or object, loop over it
        if (_.isArray(obj) || _.isObject(obj)) {
            _.forEach(obj, function (item, key) {
                obj[key] = serializeAllDates(item);
            });
        }

        return obj;
    }
function serializeAllDates ( obj ) { // if it is a date, then return serialized version if ( _ . isDate ( obj ) ) { return serializeDate ( obj ) ; } // if array or object, loop over it if ( _ . isArray ( obj ) || _ . isObject ( obj ) ) { _ . forEach ( obj , function ( item , key ) { obj [ key ] = serializeAllDates ( item ) ; } ) ; } return obj ; }
Recursively go through object and convert dates
@param obj
Recursively go through object and convert dates