diff --git a/share/jupyterhub/static/js/token.js b/share/jupyterhub/static/js/token.js index 19262313..09d25da4 100644 --- a/share/jupyterhub/static/js/token.js +++ b/share/jupyterhub/static/js/token.js @@ -12,7 +12,7 @@ require(["jquery", "jhapi", "moment"], function($, JHAPI, moment) { // convert ISO datestamps to nice momentjs ones el = $(el); let m = moment(new Date(el.text().trim())); - el.text(m.isValid() ? m.fromNow() : "Never"); + el.text(m.isValid() ? m.fromNow() : el.text()); }); $("#request-token-form").submit(function() { diff --git a/share/jupyterhub/templates/token.html b/share/jupyterhub/templates/token.html index 09ae33d9..4a82a97e 100644 --- a/share/jupyterhub/templates/token.html +++ b/share/jupyterhub/templates/token.html @@ -73,7 +73,11 @@ {%- endif -%} + {%- if token.created -%} {{ token.created.isoformat() + 'Z' }} + {%- else -%} + N/A + {%- endif -%} @@ -118,7 +122,11 @@ {%- endif -%} + {%- if client['created'] -%} {{ client['created'].isoformat() + 'Z' }} + {%- else -%} + N/A + {%- endif -%}