diff --git a/app/javascript/application.js b/app/javascript/application.js index 3b7646d..7bdfc28 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -11,6 +11,18 @@ document.addEventListener('turbo:load', (event) => { timeago.render(timeago_nodes); } + const localTimeFormatter = new Intl.DateTimeFormat(undefined, { + dateStyle: "medium", + timeStyle: "short", + timeZoneName: "short", + }); + document.querySelectorAll('time.local-time').forEach((el) => { + const date = new Date(el.getAttribute('datetime')); + if (!isNaN(date.getTime())) { + el.textContent = localTimeFormatter.format(date); + } + }); + // Copy to clipboard for key installation on servers const clipboard = new ClipboardJS('.clipboard'); clipboard.on('success', function (e) { diff --git a/app/views/destinations/deploys.html.erb b/app/views/destinations/deploys.html.erb index d4f721c..5a056fc 100644 --- a/app/views/destinations/deploys.html.erb +++ b/app/views/destinations/deploys.html.erb @@ -42,8 +42,9 @@