Skip to content

Commit

Permalink
fixed undefined timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
cubedro committed Feb 18, 2015
1 parent 469adc3 commit 7ae0bbf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions public/js/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down

0 comments on commit 7ae0bbf

Please sign in to comment.