fixed undefined timestamp
This commit is contained in:
parent
469adc33b2
commit
7ae0bbf76a
@ -67,12 +67,12 @@ angular.module('netStatsApp.filters', [])
|
|||||||
})
|
})
|
||||||
.filter('blockTimeFilter', function() {
|
.filter('blockTimeFilter', function() {
|
||||||
return function(timestamp) {
|
return function(timestamp) {
|
||||||
|
if(timestamp === 0)
|
||||||
|
return '∞';
|
||||||
|
|
||||||
var time = Math.floor((new Date()).getTime() / 1000);
|
var time = Math.floor((new Date()).getTime() / 1000);
|
||||||
var diff = time - timestamp;
|
var diff = time - timestamp;
|
||||||
|
|
||||||
if(diff === 0)
|
|
||||||
return '∞';
|
|
||||||
|
|
||||||
if(diff < 60)
|
if(diff < 60)
|
||||||
return Math.round(diff) + ' s';
|
return Math.round(diff) + ' s';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user