From 76b3ca0d33c45e87a301a64073e13d5a3bc05e0a Mon Sep 17 00:00:00 2001 From: Henk Kalkwater Date: Sun, 28 Jun 2020 00:43:15 +0200 Subject: [PATCH] Add human readable date, keep machine readable --- source/utils.d | 2 +- views/pages/article.dt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/utils.d b/source/utils.d index d4359fd..bb1a681 100644 --- a/source/utils.d +++ b/source/utils.d @@ -6,7 +6,7 @@ import std.datetime; import dyaml; string toHumanString(DateTime value) { - return to!string(value.year) ~ "-" ~ to!string(ubyte(value.month)) ~ "-" ~ to!string(value.day); + return to!string(value.day) ~ "-" ~ to!string(ubyte(value.month)) ~ "-" ~ to!string(value.year); } T getOr(T)(Node node, string key, T or) { diff --git a/views/pages/article.dt b/views/pages/article.dt index 58dbeb7..03875ec 100644 --- a/views/pages/article.dt +++ b/views/pages/article.dt @@ -19,7 +19,7 @@ block content h1.title(itemprop="headline") #{content.title} p.subtitle | By - | on + | on - if (content.isModified) - |, updated on #{content.updated.toHumanString} + |, updated on section(itemprop="articleBody") !{content.content}