registration_timestamp filter
[angular-drzb] / app / js / filters.js
index 259dd4e..2816276 100644 (file)
@@ -7,4 +7,11 @@ angular.module('myApp.filters', []).
     return function(text) {
       return String(text).replace(/\%VERSION\%/mg, version);
     }
-  }]);
+  }]).
+  filter('registration_timestamp', function() {
+    return function(text) {
+               var timestamp = parseInt( text.split(/\./)[1] );
+        var date = new Date(timestamp / 100); // 100000 / 1000
+        return date.toISOString();
+    }
+  });