diff options
Diffstat (limited to '')
| -rw-r--r-- | templates/page.tmpl | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/templates/page.tmpl b/templates/page.tmpl index cc8357d7..85d94a42 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -288,8 +288,24 @@ 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 - + // Copyright (C) 2021, 2022, 2026 Sacha Chua + + function addLocalTimeToSVGs() { + var dateOptions = { + year: 'numeric', month: 'numeric', day: 'numeric', + hour: 'numeric', minute: 'numeric', + timeZoneName: 'short' }; + document.querySelectorAll('svg a[data-start]').forEach((o) => { + let start = new Date(o.getAttribute('data-start')); + let title = o.querySelector('title'); + if (title) { + title.textContent += ' = ' + start.toLocaleString([], dateOptions); + } + }); +} + +addLocalTimeToSVGs(); + if (document.querySelector('.times')) { var dateOptions = {dateStyle: 'short', timeStyle: 'short'}; var localStart = (new Date(document.querySelector('.times').getAttribute('start'))).toLocaleString([], dateOptions); |
