diff options
author | Sacha Chua <sacha@sachachua.com> | 2023-09-25 21:06:28 -0400 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2023-09-25 21:06:28 -0400 |
commit | cdc3ca26dbaa2ef9fb793f92fe6e80c2a9b87113 (patch) | |
tree | f4b99e0b0c6f963ced3e0217bb36327e0c85a77e /templates | |
parent | f93dd965b3629ebb8eaa728e5e5ff2711487b2cf (diff) | |
download | emacsconf-wiki-cdc3ca26dbaa2ef9fb793f92fe6e80c2a9b87113.tar.xz emacsconf-wiki-cdc3ca26dbaa2ef9fb793f92fe6e80c2a9b87113.zip |
update progress report
Diffstat (limited to 'templates')
-rw-r--r-- | templates/page.tmpl | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/templates/page.tmpl b/templates/page.tmpl index ba832af6..33885246 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -295,7 +295,7 @@ Last edited <TMPL_VAR MTIME> <script> // @license magnet:?xt=urn:btih:90dc5c0be029de84e523b9b3922520e79e0e6f08&dn=cc0.txt txt CC0-1.0 // Copyright (C) 2021, 2022 Sacha Chua - + if (document.querySelector('.times')) { var dateOptions = {dateStyle: 'short', timeStyle: 'short'}; var localStart = (new Date(document.querySelector('.times').getAttribute('start'))).toLocaleString([], dateOptions); @@ -311,9 +311,15 @@ Last edited <TMPL_VAR MTIME> document.querySelectorAll('.time-overlay').forEach(function (o) { if (o.getAttribute('title')) return; var dateOptions = {dateStyle: 'short', timeStyle: 'short'}; - var localStart = (new Date(o.getAttribute('start'))).toLocaleString([], dateOptions); - var localEnd = (new Date(o.getAttribute('end'))).toLocaleString([], dateOptions); - o.setAttribute('title', 'Your local time: ~ ' + localStart + ' to ~ ' + localEnd); + var localStart, localEnd; + if (o.getAttribute('start') && o.getAttribute('end')) { + localStart = (new Date(o.getAttribute('start'))).toLocaleString([], dateOptions); + localEnd = (new Date(o.getAttribute('end'))).toLocaleString([], dateOptions); + o.setAttribute('title', 'Your local time: ~ ' + localStart + ' to ~ ' + localEnd); + } else if (o.getAttribute('start')) { + localStart = (new Date(o.getAttribute('start'))).toLocaleString([], dateOptions); + o.setAttribute('title', 'Your local time: ~ ' + localStart); + } }); } |