diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2016-09-02 15:08:57 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2016-09-02 15:08:57 -0400 |
| commit | 7231beac45e11e51a235953be28ab112ead179c4 (patch) | |
| tree | 85205bd09d26a873a676d713a88f555449ac049c /www/js/TimelineModalCtrl.js | |
| parent | 38851d4a73856ea4e36a50dde6bc8be462673ee6 (diff) | |
humanize time difference for other views too
Former-commit-id: dd6df8dd23512f22c802d4f41c2c64da25b59282
Diffstat (limited to 'www/js/TimelineModalCtrl.js')
| -rw-r--r-- | www/js/TimelineModalCtrl.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/www/js/TimelineModalCtrl.js b/www/js/TimelineModalCtrl.js index aa403010..a4b2cb4b 100644 --- a/www/js/TimelineModalCtrl.js +++ b/www/js/TimelineModalCtrl.js @@ -176,6 +176,8 @@ angular.module('zmApp.controllers').controller('TimelineModalCtrl', ['$scope', ' }); $scope.eventdetails = $translate.instant('kLoading') + "..."; + $scope.mName = ZMDataModel.getMonitorName($scope.event.Event.MonitorId); + $scope.humanizeTime = humanizeTime($scope.event.Event.StartTime); processEvent(); //$scope.eventdetails = JSON.stringify($scope.event); }); @@ -440,6 +442,15 @@ angular.module('zmApp.controllers').controller('TimelineModalCtrl', ['$scope', ' } + function humanizeTime(str) + { + var et = moment(str); + var m = moment.duration(moment().diff(et)).humanize(); + + var r = m+' '+$translate.instant('kAgo'); + return (r); + + } function padToN(number, digits) { |
