format dates as dates

This commit is contained in:
j 2017-03-04 12:05:14 +01:00
parent 7ac8fefcf4
commit 3a6bfa8946

View file

@ -716,6 +716,11 @@ pandora.ui.infoView = function(data) {
var ret; var ret;
if (key == 'year') { if (key == 'year') {
ret = formatLink(value, 'year'); ret = formatLink(value, 'year');
} else if (['releasedate', 'dateofcensorcertificate'].indexOf(key) > -1) {
ret = value ? Ox.formatDate(value,
['', '%Y', '%B %Y', '%B %e, %Y'][value.split('-').length],
true
) : '';
} else if (key == 'links') { } else if (key == 'links') {
ret = value.split(', ').map(function(link) { ret = value.split(', ').map(function(link) {
return '<a href="' + link + '">' + Ox.parseURL(link).host + '</a>'; return '<a href="' + link + '">' + Ox.parseURL(link).host + '</a>';