From ab9e3906e2d7cbe51251e3440d279eddd6bbb14e Mon Sep 17 00:00:00 2001 From: kilo Date: Mon, 7 Aug 2017 06:51:25 +0200 Subject: [PATCH] Fix main.js (#1352) * Update main.js * Update main.js * Update main.js * Update main.js --- public/js/main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) } }