diff --git a/boards/static/js/main.js b/boards/static/js/main.js --- a/boards/static/js/main.js +++ b/boards/static/js/main.js @@ -23,6 +23,15 @@ for the JavaScript code in this page. */ +var LOCALE = window.navigator.language; +var FORMATTER = new Intl.DateTimeFormat( + LOCALE, + { + weekday: 'short', year: 'numeric', month: 'short', day: 'numeric', + hour: 'numeric', minute: '2-digit', second: '2-digit' + } +); + /** * An email is a hidden file to prevent spam bots from posting. It has to be * hidden. @@ -40,6 +49,32 @@ function highlightCode(node) { }); } +/** + * Translate timestamps to local ones for all