From 242b3bb374e81180eaa2a01f24a14750f9c5ed2b Mon Sep 17 00:00:00 2001 From: j Date: Sun, 5 Aug 2018 18:42:23 +0100 Subject: [PATCH] not all dates are actual dates --- static/js/infoView.amp.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/static/js/infoView.amp.js b/static/js/infoView.amp.js index a72ce05..d0e3a93 100644 --- a/static/js/infoView.amp.js +++ b/static/js/infoView.amp.js @@ -565,10 +565,14 @@ pandora.ui.infoView = function(data) { function formatValue(key, value) { var ret; - if (key == 'date') { + if (key == 'date' && (!value || value.split('-').length < 4)) { ret = value ? Ox.formatDate(value, - ['', '%Y', '%B %Y', '%B %e, %Y'][value.split('-').length] + ['', '%Y', '%B %Y', '%B %e, %Y'][value.split('-').length], + true ) : ''; + if (ret == NaN) { + ret = value + } } else if (key == 'links') { ret = value.split(', ').map(function(link) { return '' + Ox.parseURL(link).host + '';