From 7ae0bbf76af6f111e80ec54d9f6fe9b1db109312 Mon Sep 17 00:00:00 2001 From: cubedro Date: Wed, 18 Feb 2015 11:11:26 +0200 Subject: [PATCH] fixed undefined timestamp --- public/js/filters.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/js/filters.js b/public/js/filters.js index 28a6021..658f6e2 100644 --- a/public/js/filters.js +++ b/public/js/filters.js @@ -67,12 +67,12 @@ angular.module('netStatsApp.filters', []) }) .filter('blockTimeFilter', function() { return function(timestamp) { + if(timestamp === 0) + return '∞'; + var time = Math.floor((new Date()).getTime() / 1000); var diff = time - timestamp; - if(diff === 0) - return '∞'; - if(diff < 60) return Math.round(diff) + ' s';