First draft of filters, moment API missing

Conflicts:
	app/table/cell_duration/cell_duration.html
	app/table/cell_last_check/cell_last_check.html
This commit is contained in:
Frédéric Vachon 2015-01-26 16:12:13 -05:00
parent a2ce299b3a
commit 614ea2aa0f
5 changed files with 20 additions and 3 deletions

View File

@ -5,7 +5,8 @@ angular.module('adagios', [
'adagios.sidebar',
'adagios.topbar',
'adagios.tactical',
'adagios.table'
'adagios.table',
'adagios.filters'
])
.config(['$routeProvider', function ($routeProvider) {

View File

@ -0,0 +1,9 @@
'use strict';
angular.module('adagios.filters', [])
.filter('timeElapsed', [function () {
return function(input) {
return moment.unix(input).fromNow();
}
}]);

View File

@ -17,12 +17,15 @@
<!-- Application -->
<script src="app.js"></script>
<!-- COMPONENTS -->
<script src="components/live/live.js"></script>
<script src="components/live/notifications.js"></script>
<script src="components/live/get_services.js"></script>
<script src="components/ng-justgage/ng-justgage.js"></script>
<script src="components/filters/filters.js"></script>
<!-- MODULES -->
<script src="sidebar/sidebar.js"></script>

View File

@ -1 +1,3 @@
<div>{{entry.last_state_change}}</div>
<div ng-controller="CellDurationCtrl">
<div>{{field1 | timeElapsed}}</div>
</div>

View File

@ -1 +1,3 @@
<div>{{entry.last_check}}</div>
<div ng-controller="CellLastCheckCtrl">
<div>{{field1 * 1000 | date: medium}}</div>
</div>