Integrate moment.js and its angular bindings.

This commit is contained in:
yackob03 2013-09-27 15:26:30 -04:00
parent 98dc20542c
commit 4354b32288
4 changed files with 10 additions and 3 deletions

View file

@ -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) {
var userResponse = {
verified: false,

View file

@ -28,7 +28,11 @@ function RepoCtrl($scope, Restangular, $routeParams, $rootScope) {
$('#editModal').modal('hide');
$scope.repo.description = $('#descriptionEdit')[0].value;
$scope.repo.put();
};
};
$scope.parseDate = function(dateString) {
return Date.parse(dateString);
};
var namespace = $routeParams.namespace;
var name = $routeParams.name;

View file

@ -39,7 +39,7 @@
<div id="current-image">
<dl class="dl-horizontal">
<dt>Created</dt>
<dd>{{ currentTag.image.created }}</dd>
<dd am-time-ago="parseDate(currentTag.image.created)"></dd>
<dt>ID</dt>
<dd>{{ currentTag.image.id }}</dd>

View file

@ -18,6 +18,9 @@
<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="//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/controllers.js"></script>