Integrate moment.js and its angular bindings.
This commit is contained in:
parent
98dc20542c
commit
4354b32288
4 changed files with 10 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
quayApp = angular.module('quay', ['restangular'], function($provide) {
|
quayApp = angular.module('quay', ['restangular', 'angularMoment'], function($provide) {
|
||||||
$provide.factory('UserService', ['Restangular', function(Restangular) {
|
$provide.factory('UserService', ['Restangular', function(Restangular) {
|
||||||
var userResponse = {
|
var userResponse = {
|
||||||
verified: false,
|
verified: false,
|
||||||
|
|
|
@ -30,6 +30,10 @@ function RepoCtrl($scope, Restangular, $routeParams, $rootScope) {
|
||||||
$scope.repo.put();
|
$scope.repo.put();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.parseDate = function(dateString) {
|
||||||
|
return Date.parse(dateString);
|
||||||
|
};
|
||||||
|
|
||||||
var namespace = $routeParams.namespace;
|
var namespace = $routeParams.namespace;
|
||||||
var name = $routeParams.name;
|
var name = $routeParams.name;
|
||||||
var tag = $routeParams.tag || 'latest';
|
var tag = $routeParams.tag || 'latest';
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
<div id="current-image">
|
<div id="current-image">
|
||||||
<dl class="dl-horizontal">
|
<dl class="dl-horizontal">
|
||||||
<dt>Created</dt>
|
<dt>Created</dt>
|
||||||
<dd>{{ currentTag.image.created }}</dd>
|
<dd am-time-ago="parseDate(currentTag.image.created)"></dd>
|
||||||
|
|
||||||
<dt>ID</dt>
|
<dt>ID</dt>
|
||||||
<dd>{{ currentTag.image.id }}</dd>
|
<dd>{{ currentTag.image.id }}</dd>
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
<script src="//cdn.jsdelivr.net/underscorejs/1.5.2/underscore-min.js"></script>
|
<script src="//cdn.jsdelivr.net/underscorejs/1.5.2/underscore-min.js"></script>
|
||||||
<script src="//cdn.jsdelivr.net/restangular/1.1.3/restangular.js"></script>
|
<script src="//cdn.jsdelivr.net/restangular/1.1.3/restangular.js"></script>
|
||||||
|
|
||||||
|
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.2.1/moment.min.js"></script>
|
||||||
|
<script src="static/lib/angular-moment.min.js"></script>
|
||||||
|
|
||||||
<script src="static/js/app.js"></script>
|
<script src="static/js/app.js"></script>
|
||||||
<script src="static/js/controllers.js"></script>
|
<script src="static/js/controllers.js"></script>
|
||||||
|
|
||||||
|
|
Reference in a new issue