diff --git a/public/js/main.js b/public/js/main.js index 0acbefa1..840284cd 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -53,16 +53,16 @@ function parseAllDates() { var list = document.getElementsByClassName("date-full") for (var i in list) { + if(list.length == 0) + break; var e = list[i] var dateDifference = dateDiff(new Date(e.innerText), new Date()) - if(e.className.includes("scrape-date")) - e.title = ((dateDifference.d * 24) + dateDifference.h) + " hours " + dateDifference.m + " minutes ago" + - //e.title = T.r("torrent_age2", dateDifference.h, dateDifference.m) + if(e.className != undefined && e.className.includes("scrape-date")) + e.title = ((dateDifference.d * 24) + dateDifference.h) + " hours " + dateDifference.m + " minutes ago" else e.title = dateDifference.d + " days " + dateDifference.h + " hours ago" - //e.title = T.r("torrent_age", dateDifference.d, dateDifference.h) e.innerText = new Date(e.innerText).toLocaleString(lang) } }