Andy Baugh 6 rokov pred
rodič
commit
9517c494ee

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

@@ -48,13 +48,15 @@
 
 <script type="text/javascript">
     //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) {
         var dstatus   = document.getElementById(id).style.display;