소스 검색

Don't double-parse timestamps

George S. Baugh 3 달 전
부모
커밋
654bd1013b
1개의 변경된 파일과 4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      www/templates/html/components/posts.tx

+ 4 - 0
www/templates/html/components/posts.tx

@@ -78,6 +78,10 @@ document.addEventListener("DOMContentLoaded", function(){
             // Fix post dates to be localized
             var timey = document.querySelectorAll('.unixtimestamp');
             for (var e of timey) {
+                if (parseInt(e.innerText) != e.innerText) {
+                    // Don't do anything.
+                    continue;
+                }
                 var d = new Date(0);
                 d.setUTCSeconds(e.innerText);
                 e.innerHTML = " " + d.toDateString();