From 054de9860af60431ac1a5a9b8672d974f1783b6c Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sun, 25 Aug 2013 11:08:20 +0100 Subject: [PATCH] Fix display of build timestamp ("44 years ago"...) --- html/index.html | 2 +- html/js/melpa.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/html/index.html b/html/index.html index 720130e9..9ba463e8 100644 --- a/html/index.html +++ b/html/index.html @@ -49,7 +49,7 @@
- Latest build: {{buildStatus.completed | relativeTime}} + Latest build: {{completionTime | relativeTime}}
diff --git a/html/js/melpa.js b/html/js/melpa.js index bcb77c91..40a3c80e 100644 --- a/html/js/melpa.js +++ b/html/js/melpa.js @@ -137,7 +137,9 @@ }; app.controller('BuildStatusCtrl', function($scope, packageService) { - $scope.buildStatus = packageService.buildStatus(); + packageService.buildStatus().then(function(status) { + $scope.completionTime = new Date(status.completed * 1000); + }); }); app.controller('AppCtrl', function($scope, $rootScope, $route) { @@ -220,7 +222,7 @@ ////////////////////////////////////////////////////////////////////////////// app.filter('relativeTime', function() { return function(val) { - return val && moment(new Date(val)).fromNow(); + return val && moment(val).fromNow(); }; });