From c76aa17b78eddb9ba7ed6259d5b2c0f137d8367b Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Thu, 25 Feb 2016 18:25:28 -0800 Subject: [PATCH] wb.js: pad timestamp to 14 digits --- pywb/static/wb.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pywb/static/wb.js b/pywb/static/wb.js index dc482a5c..e186f1df 100644 --- a/pywb/static/wb.js +++ b/pywb/static/wb.js @@ -63,8 +63,12 @@ this.create_banner_element = function() { this.ts_to_date = function(ts, is_gmt) { + if (!ts) { + return ""; + } + if (ts.length < 14) { - return ts; + ts += "00000000000000".substr(ts.length); } var datestr = (ts.substring(0, 4) + "-" +