angular.module('com.dailymotion.ngEveResource')
    .factory('eveResource', function($resource) {
        return function(url, paramDefaults, actions, options, toJsonReplacer) {
            var Resource,
                toJSON;

            if (!angular.isFunction(toJsonReplacer)) {
                if (angular.isFunction(options)) {
                    toJsonReplacer = options;
                    options = {};
                } else {
                    toJsonReplacer = function(key, value) {
                        return value;
                    };
                }
            }

            Resource = $resource(url, paramDefaults, actions, options);

            toJSON = Resource.prototype.toJSON;

            Resource.prototype.toJSON = function() {
                var data = toJSON.call(this);

                angular.forEach(data, function(value, key) {
                    data[key] = key.charAt(0) === '_' ? undefined : toJsonReplacer(key, value);
                });

                return data;
            };

            Resource.prototype.exists = function() {
                return !!this._id;
            };

            return Resource;
        };
    });

@@ -41,16 +41,96 @@
 ource')%0A
+    .constant(%22eveCfg%22, %7B%0A        %22dateformat%22: %22YYYY-MM-DDTHH:mm:ss%5BZ%5D%22%0A    %7D)%0A
     .fac
@@ -161,18 +161,36 @@
 tion
+ 
 ($
-resource
+window, $resource, eveCfg
 ) %7B%0A
@@ -1226,32 +1226,471 @@
             %7D;%0A%0A
+            function format (time, fmt) %7B%0A                return $window.moment && $window.moment.utc ? moment.utc(time).format(fmt %7C%7C eveCfg.dateformat) : time;%0A            %7D%0A%0A            Resource.prototype.formatUpdated = function (fmt) %7B%0A                return format(this._updated, fmt);%0A            %7D;%0A%0A            Resource.prototype.formatCreated = function (fmt) %7B%0A                return format(this._created, fmt);%0A            %7D;%0A%0A
             retu

format eve object's updated and created timestamp