From: Dobrica Pavlinusic Date: Wed, 9 Jan 2013 14:07:09 +0000 (+0100) Subject: registration_timestamp filter X-Git-Tag: 0.4~25 X-Git-Url: http://git.rot13.org/?p=angular-drzb;a=commitdiff_plain;h=3dfc634f4daf6ff76717ed3119d99bf77c48e930 registration_timestamp filter --- diff --git a/app/js/filters.js b/app/js/filters.js index 259dd4e..2816276 100644 --- a/app/js/filters.js +++ b/app/js/filters.js @@ -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(); + } + }); diff --git a/app/partials/list.html.ep b/app/partials/list.html.ep index b7f3989..7fbbb32 100644 --- a/app/partials/list.html.ep +++ b/app/partials/list.html.ep @@ -36,6 +36,7 @@ Search: edit {{registration.user.registration_type}} {{registration._id}} + {{registration._id | registration_timestamp}}

{{registration.user.firstname}}