Fix parseAllDates() that could break dates (in listing) (#1749)
* Fix parseAllDates() that could break dates (in listing) Fix parseAllDates() that would break torrent list dates if it had already been executed before * check if date value is NaN before applying it
Cette révision appartient à :
Parent
1eecbfecd0
révision
860f9c8eb1
1 fichiers modifiés avec 4 ajouts et 2 suppressions
|
@ -59,8 +59,10 @@ function parseAllDates() {
|
|||
var list = document.getElementsByClassName("date-short")
|
||||
for(var i = 0; i < list.length; i++) {
|
||||
var e = list[i]
|
||||
e.innerText = new Date(e.title).toLocaleString(lang, ymdOpt)
|
||||
e.title = new Date(e.title).toLocaleString(lang)
|
||||
var newDate = new Date(e.title)
|
||||
if(isNaN(newDate.valueOf())) continue
|
||||
e.innerText = newDate.toLocaleString(lang, ymdOpt)
|
||||
e.title = newDate.toLocaleString(lang)
|
||||
}
|
||||
|
||||
var list = document.getElementsByClassName("date-full")
|
||||
|
|
Référencer dans un nouveau ticket