From: pablozg Date: Thu, 25 Oct 2018 16:21:00 +0000 (+0200) Subject: webui: Fix #5292 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=424a108b0fb8d77b2445fa7937fd8d2dfd86feb2;p=thirdparty%2Ftvheadend.git webui: Fix #5292 --- diff --git a/src/webui/static/app/ext.css b/src/webui/static/app/ext.css index d1f4f4bde..6b0966d47 100644 --- a/src/webui/static/app/ext.css +++ b/src/webui/static/app/ext.css @@ -656,6 +656,10 @@ width: 100px; } +.x-nice-customformat { + display: inline-block; + width: 18em; +} .x-nice-dayofweek { display: inline-block; diff --git a/src/webui/static/app/tvheadend.js b/src/webui/static/app/tvheadend.js index 7bc17a1f8..2346b5484 100644 --- a/src/webui/static/app/tvheadend.js +++ b/src/webui/static/app/tvheadend.js @@ -746,9 +746,13 @@ Ext.Ajax.request({ */ tvheadend.niceDate = function(dt) { var d = new Date(dt); - return '
' + d.toLocaleString(tvheadend.toLocaleFormat(), {weekday: 'long'}) + '
' + - '
' + d.toLocaleDateString(tvheadend.toLocaleFormat()) + '
' + - '
' + d.toLocaleTimeString() + '
'; + if (/([%][MmsSyYdhq]+)/.test(tvheadend.date_mask)){ + return '
' + tvheadend.toCustomDate(d, tvheadend.date_mask) + '
'; + }else{ + return '
' + d.toLocaleString(tvheadend.toLocaleFormat(), {weekday: 'long'}) + '
' + + '
' + d.toLocaleDateString(tvheadend.toLocaleFormat(), {day: '2-digit', month: '2-digit', year: 'numeric'}) + '
' + + '
' + d.toLocaleTimeString(tvheadend.toLocaleFormat(), {hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false}) + '
'; + } } /* Date format when time is not needed, e.g., first_aired time is @@ -790,7 +794,7 @@ tvheadend.niceDateYearMonth = function(dt, refdate) { } } return '
' + d.toLocaleString(tvheadend.toLocaleFormat(), {weekday: 'long'}) + '
' + - '
' + d.toLocaleDateString(tvheadend.toLocaleFormat()) + '
'; + '
' + d.toLocaleDateString(tvheadend.toLocaleFormat(), {day: '2-digit', month: '2-digit', year: 'numeric'}) + '
'; } /*