diff --git a/static/scripts/relativetime.js b/static/scripts/relativetime.js new file mode 100644 index 0000000..cc7cad6 --- /dev/null +++ b/static/scripts/relativetime.js @@ -0,0 +1,10 @@ +"use strict"; + +Array.from(document.getElementsByClassName("relative-timestamp")).forEach( + function (timestamp) { + timestamp.innerText = new Intl.DateTimeFormat(undefined, { + dateStyle: "long", + timeStyle: "short", + }).format(new Date(timestamp.dateTime)); + } +); diff --git a/templates/page.html b/templates/page.html index 1352a52..a9fa884 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {% block metadata %} + {% endblock %} {% block content %}

{{ page.title }}

@@ -8,7 +9,7 @@ {% if page.date and page.date is defined %}

First published: - @@ -16,7 +17,7 @@ {% endif %} {% if page.updated and page.updated != page.date %}

Last updated on: -