diff options
Diffstat (limited to '')
| -rw-r--r-- | script.js | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -55,7 +55,23 @@ } // @license-end // @license magnet:?xt=urn:btih:90dc5c0be029de84e523b9b3922520e79e0e6f08&dn=cc0.txt txt CC0-1.0 - // Copyright (C) 2021, 2022 Sacha Chua +// Copyright (C) 2021, 2022 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'}; |
