diff --git a/dashboard-ui/bower_components/emby-webcomponents/datetime.js b/dashboard-ui/bower_components/emby-webcomponents/datetime.js index 92c7afa59..dc9f11309 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/datetime.js +++ b/dashboard-ui/bower_components/emby-webcomponents/datetime.js @@ -114,6 +114,16 @@ function getDisplayTime(date) { + if ((typeof date).toString().toLowerCase() === 'string') { + try { + + date = parseISO8601Date(date, true); + + } catch (err) { + return date; + } + } + var currentLocale = globalize.getCurrentLocale(); var time = currentLocale && toLocaleTimeStringSupportsLocales ? @@ -124,7 +134,6 @@ if (timeLower.indexOf('am') != -1 || timeLower.indexOf('pm') != -1) { - time = timeLower; var hour = date.getHours() % 12; var suffix = date.getHours() > 11 ? 'pm' : 'am'; if (!hour) { diff --git a/dashboard-ui/components/remotecontrolautoplay.js b/dashboard-ui/components/remotecontrolautoplay.js index 6689ea300..adae74079 100644 --- a/dashboard-ui/components/remotecontrolautoplay.js +++ b/dashboard-ui/components/remotecontrolautoplay.js @@ -1,4 +1,4 @@ -(function () { +define(['events'], function (events) { function transferPlayback(oldPlayer) { @@ -25,7 +25,7 @@ }); } - Events.on(MediaController, 'playerchange', function (e, newPlayer, newTarget, oldPlayer) { + events.on(MediaController, 'playerchange', function (e, newPlayer, newTarget, oldPlayer) { if (!oldPlayer) { console.log('Skipping remote control autoplay because oldPlayer is null'); @@ -48,4 +48,4 @@ } }); -})(); \ No newline at end of file +}); \ No newline at end of file diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 53d93cfad..9d9cdefcd 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -1,4 +1,4 @@ -define(['playlistManager', 'appSettings', 'appStorage', 'apphost', 'jQuery', 'scrollStyles'], function (playlistManager, appSettings, appStorage, appHost, $) { +define(['playlistManager', 'appSettings', 'appStorage', 'apphost', 'datetime', 'jQuery', 'scrollStyles'], function (playlistManager, appSettings, appStorage, appHost, datetime, $) { var libraryBrowser = (function (window, document, screen) { @@ -3413,56 +3413,6 @@ detailImageProgressContainer.innerHTML = progressHtml || ''; }, - getDisplayTime: function (date) { - - if ((typeof date).toString().toLowerCase() === 'string') { - try { - - date = parseISO8601Date(date, { toLocal: true }); - - } catch (err) { - return date; - } - } - - var lower = date.toLocaleTimeString().toLowerCase(); - - var hours = date.getHours(); - var minutes = date.getMinutes(); - - var text; - - if (lower.indexOf('am') != -1 || lower.indexOf('pm') != -1) { - - var suffix = hours > 11 ? 'pm' : 'am'; - - hours = (hours % 12) || 12; - - text = hours; - - if (minutes) { - - text += ':'; - if (minutes < 10) { - text += '0'; - } - text += minutes; - } - - text += suffix; - - } else { - text = hours + ':'; - - if (minutes < 10) { - text += '0'; - } - text += minutes; - } - - return text; - }, - getMiscInfoHtml: function (item) { var miscInfo = []; @@ -3512,7 +3462,7 @@ miscInfo.push(text); if (item.Type != "Recording") { - text = LibraryBrowser.getDisplayTime(date); + text = datetime.getDisplayTime(date); miscInfo.push(text); } } diff --git a/dashboard-ui/scripts/livetvchannel.js b/dashboard-ui/scripts/livetvchannel.js index 72a25b500..1e6800b1b 100644 --- a/dashboard-ui/scripts/livetvchannel.js +++ b/dashboard-ui/scripts/livetvchannel.js @@ -1,4 +1,4 @@ -define(['jQuery'], function ($) { +define(['datetime'], function (datetime) { function renderPrograms(page, result) { @@ -32,7 +32,7 @@ } html += '