Andy Baugh 6 年之前
父节点
当前提交
9517c494ee
共有 1 个文件被更改,包括 9 次插入7 次删除
  1. 9 7
      notification-center/notification-center.tt

+ 9 - 7
notification-center/notification-center.tt

@@ -48,13 +48,15 @@
 
 
 <script type="text/javascript">
 <script type="text/javascript">
     //Localize all the timestamps on the page
     //Localize all the timestamps on the page
-    var timestamps = document.querySelectorAll('.timestamp');
-    for (var i=0; i < timestamps.length; i++) {
-        var timestamp = timestamps[i];
-        var t = new Date(0)
-        t.setUTCSeconds(timestamp);
-        timestamps[i].innerText = t.toLocaleDateString() + " " + t.toLocaleTimeString();
-    }
+    window.onload = function () {
+        var timestamps = document.querySelectorAll('.timestamp');
+        for (var i=0; i < timestamps.length; i++) {
+            var timestamp = timestamps[i];
+            var t = new Date(0)
+            t.setUTCSeconds(timestamp);
+            timestamps[i].innerText = t.toLocaleDateString() + " " + t.toLocaleTimeString();
+        }
+    };
 
 
     function toggleContentDisplay(id) {
     function toggleContentDisplay(id) {
         var dstatus   = document.getElementById(id).style.display;
         var dstatus   = document.getElementById(id).style.display;