registration_timestamp filter
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 9 Jan 2013 14:07:09 +0000 (15:07 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 9 Jan 2013 14:07:09 +0000 (15:07 +0100)
app/js/filters.js
app/partials/list.html.ep

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();
+    }
+  });
index b7f3989..7fbbb32 100644 (file)
@@ -36,6 +36,7 @@ Search:
  <a href="#/registration/{{registration.id}}">edit</a>
  {{registration.user.registration_type}}
  <tt>{{registration._id}}</tt>
+ {{registration._id | registration_timestamp}}
 
        <p>
         {{registration.user.firstname}}