From ba7e791985276c8e80b054e80577463764512386 Mon Sep 17 00:00:00 2001 From: William Kim Date: Mon, 12 Aug 2013 12:15:47 -0400 Subject: [PATCH] initial moment time formatting commit. --- .../src/main/webapp/resources/js/grant.js | 7 ++++++- .../src/main/webapp/resources/template/grant.html | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/openid-connect-server/src/main/webapp/resources/js/grant.js b/openid-connect-server/src/main/webapp/resources/js/grant.js index c9e5cd0a0..513f0fd8a 100644 --- a/openid-connect-server/src/main/webapp/resources/js/grant.js +++ b/openid-connect-server/src/main/webapp/resources/js/grant.js @@ -117,7 +117,12 @@ var ApprovedSiteView = Backbone.View.extend({ }, render: function() { - var json = {grant: this.model.toJSON(), client: this.options.client.toJSON()}; + + var formattedDate = {creationDate: moment(this.model.creationDate).format("ddd, hA"), + accessDate: moment(this.model.accessDate), + timeoutDate: moment(this.model.timeoutDate)}; + + var json = {grant: this.model.toJSON(), client: this.options.client.toJSON(), formattedDate: formattedDate}; this.$el.html(this.template(json)); diff --git a/openid-connect-server/src/main/webapp/resources/template/grant.html b/openid-connect-server/src/main/webapp/resources/template/grant.html index 0aef6fa50..e0b7bedc0 100644 --- a/openid-connect-server/src/main/webapp/resources/template/grant.html +++ b/openid-connect-server/src/main/webapp/resources/template/grant.html @@ -96,15 +96,15 @@ - <%= grant.creationDate %> + <%= formattedDate.creationDate %> - <%= grant.accessDate %> + <%= formattedDate.accessDate %> - <%= grant.timeoutDate %> + <%= formattedDate.timeoutDate %>