index.js
function parse_date_strings(root) {
    for (key in root) {
        if (!root.hasOwnProperty(key)) continue;
        var value = root[key];
        if (typeof(value) === 'object') { 
            parse_date_strings(value);
        } else if (typeof(value) === 'string' && /\d{4}-?\d{2}-?\d{2}(T?\d{2}:?\d{2}:?\d{2}(Z)?)?/.test(value)) {
            var timestamp = Date.parse(value);
            if (!isNaN(timestamp)) {
                root[key] = new Date(timestamp);
            }
        }
    }
}
function parse_date_strings(root) {
    for (key in root) {
        if (!root.hasOwnProperty(key)) continue;
        var value = root[key];
        if (typeof(value) === 'object') { 
            parse_date_strings(value);
        } else if (typeof(value) === 'string' && /\d{4}-?\d{2}-?\d{2}(T?\d{2}:?\d{2}:?\d{2}(Z)?)?/.test(value)) {
            var timestamp = Date.parse(value);
            if (!isNaN(timestamp)) {
                root[key] = new Date(timestamp);
            }
        }
    }
}
function parse_date_strings ( root ) { for ( key in root ) { if ( ! root . hasOwnProperty ( key ) ) continue ; var value = root [ key ] ; if ( typeof ( value ) === 'object' ) { parse_date_strings ( value ) ; } else if ( typeof ( value ) === 'string' && / \d{4}-?\d{2}-?\d{2}(T?\d{2}:?\d{2}:?\d{2}(Z)?)? / . test ( value ) ) { var timestamp = Date . parse ( value ) ; if ( ! isNaN ( timestamp ) ) { root [ key ] = new Date ( timestamp ) ; } } } }
helper to recursively parse all date strings into Date objects
helper to recursively parse all date strings into Date objects