Andy Baugh 6 years ago
parent
commit
9517c494ee
1 changed files with 9 additions and 7 deletions
  1. 9 7
      notification-center/notification-center.tt

+ 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;