diff options
Diffstat (limited to 'src/jwebmail/static/src/localtime.js')
-rw-r--r-- | src/jwebmail/static/src/localtime.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/jwebmail/static/src/localtime.js b/src/jwebmail/static/src/localtime.js new file mode 100644 index 0000000..daa1455 --- /dev/null +++ b/src/jwebmail/static/src/localtime.js @@ -0,0 +1,5 @@ +document.querySelectorAll('time.jwm-tolocaltime').forEach($e => { + const dateTime = new Date($e.dateTime); + $e.innerHTML = new Intl.DateTimeFormat(document.documentElement.lang). + format(dateTime.toLocaleString()); +}); |