From 025eb05d3a9d1fa2c121ae7691b6d6ad4970d74e Mon Sep 17 00:00:00 2001 From: William Kim Date: Mon, 12 Aug 2013 16:15:06 -0400 Subject: [PATCH] added date format validity check for moment.js usage. --- openid-connect-server/src/main/webapp/resources/js/grant.js | 6 +++--- 1 file changed, 3 insertions(+), 3 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 fe0bd5c7f..5392c64a4 100644 --- a/openid-connect-server/src/main/webapp/resources/js/grant.js +++ b/openid-connect-server/src/main/webapp/resources/js/grant.js @@ -122,7 +122,7 @@ var ApprovedSiteView = Backbone.View.extend({ var accessDate = this.model.get("accessDate"); var timeoutDate = this.model.get("timeoutDate"); - if (creationDate == null) { + if (creationDate == null || !moment(creationDate).isValid()) { creationDate = "Unknown"; } else { creationDate = moment(creationDate); @@ -133,7 +133,7 @@ var ApprovedSiteView = Backbone.View.extend({ } } - if (accessDate == null) { + if (accessDate == null || !moment(accessDate).isValid()) { accessDate = "Unknown"; } else { accessDate = moment(accessDate); @@ -144,7 +144,7 @@ var ApprovedSiteView = Backbone.View.extend({ } } - if (timeoutDate == null) { + if (timeoutDate == null || !moment(timeoutDate).isValid()) { timeoutDate = "Never"; } else { timeoutDate = moment(timeoutDate).calendar();