JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
render timestamps
authorJason Woofenden <jason@jasonwoof.com>
Wed, 21 Jun 2017 03:24:31 +0000 (23:24 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Wed, 21 Jun 2017 03:24:31 +0000 (23:24 -0400)
admin_pages.html

index 638b630..0d5614c 100644 (file)
                        <table cellspacing="0" cellpadding="4" border="0" summary="" class="evenodd">
                                <tr>
                                        <th>title</th>
                        <table cellspacing="0" cellpadding="4" border="0" summary="" class="evenodd">
                                <tr>
                                        <th>title</th>
-                                       <th>at</th>
+                                       <th>saved at</th>
                                        <th>by</th>
                                        <th></th>
                                </tr>
                                        <th>by</th>
                                        <th></th>
                                </tr>
                                                </td>
                                        </tr>
                                <!--~}~-->
                                                </td>
                                        </tr>
                                <!--~}~-->
+                               <script>
+                                       (function () {
+                                               var i, i02, d, hours, el, els
+                                               i02 = function (i) { return i > 9 ? i : '0' + i }
+                                               els = document.getElementsByClassName('timestamp');
+                                               for (i = 0; i < els.length; ++i) {
+                                                       el = els[i]
+                                                       d = new Date(parseInt(el.innerText) * 1000)
+                                                       hours = d.getHours();
+                                                       el.innerText =
+                                                               i02(d.getMonth() + 1) + '/' +
+                                                               i02(d.getDate()) + '/' +
+                                                               d.getFullYear() + ' ' +
+                                                               i02((hours + 11) % 12 + 1) + ':' +
+                                                               i02(d.getMinutes()) + '' +
+                                                               (hours < 12 ? 'am' : 'pm')
+                                               }
+                                       })();
+                               </script>
                        </table>
                <!--~}~-->
        <!--~}~-->
                        </table>
                <!--~}~-->
        <!--~}~-->