diff --git a/static/js/localdate.js b/static/js/localdate.js new file mode 100644 index 0000000..19fa502 --- /dev/null +++ b/static/js/localdate.js @@ -0,0 +1,9 @@ +function toLocalDate(el) { + var d = new Date(el.getAttribute("datetime")); + el.textContent = d.toLocaleDateString(navigator.language || "en-US", { year: 'numeric', month: 'long', day: 'numeric' }); +} + +var $dates = document.querySelectorAll("time"); +for (var i=0; i < $dates.length; i++) { + toLocalDate($dates[i]); +} diff --git a/templates/chorus-collection-post.tmpl b/templates/chorus-collection-post.tmpl index bab2e31..e60a435 100644 --- a/templates/chorus-collection-post.tmpl +++ b/templates/chorus-collection-post.tmpl @@ -90,6 +90,7 @@ article time.dt-published { {{range .Collection.ExternalScripts}}{{end}} {{if .Collection.Script}}{{end}} {{end}} + {{end}} {{if .Collection.Script}}{{end}} {{end}} + +