registration_timestamp filter
[angular-drzb] / app / js / filters.js
1 'use strict';
2
3 /* Filters */
4
5 angular.module('myApp.filters', []).
6   filter('interpolate', ['version', function(version) {
7     return function(text) {
8       return String(text).replace(/\%VERSION\%/mg, version);
9     }
10   }]).
11   filter('registration_timestamp', function() {
12     return function(text) {
13                 var timestamp = parseInt( text.split(/\./)[1] );
14         var date = new Date(timestamp / 100); // 100000 / 1000
15         return date.toISOString();
16     }
17   });