mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
lazy load scripts
This commit is contained in:
parent
7e55abc130
commit
3818349496
27 changed files with 510 additions and 443 deletions
|
@ -2619,6 +2619,56 @@
|
|||
elem.lazyChildren();
|
||||
},
|
||||
|
||||
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 = [];
|
||||
|
@ -2649,7 +2699,7 @@
|
|||
miscInfo.push(text);
|
||||
|
||||
if (item.Type != "Recording") {
|
||||
text = LiveTvHelpers.getDisplayTime(date);
|
||||
text = LibraryBrowser.getDisplayTime(date);
|
||||
miscInfo.push(text);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue