From 22d96bbd8d2f3c63328e0beb4e192eb9bf3d5ce3 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 13 Oct 2024 22:23:59 +0200 Subject: Format human dates in view templates rather than in server queries. --- views/head.pug | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'views/head.pug') diff --git a/views/head.pug b/views/head.pug index 66e3f58..d9da995 100644 --- a/views/head.pug +++ b/views/head.pug @@ -28,10 +28,10 @@ mixin forumpost(row,show_buttons) .post(id=row.post_id) .head .from: b: a.black(href="/user/"+row.author_name)= row.author_name - .time= row.ctime + .time= human_date(row.ctime) if row.edited | - | (edited #{row.mtime}) + | (edited #{human_date(row.mtime)}) .body!= row.body if show_buttons && user .edit @@ -120,9 +120,9 @@ mixin gamelist(list,hide_title=0) div Players: Nobody case item.status when 0 - div Created: #{item.ctime} + div Created: #{human_date(item.ctime)} when 1 - div Last move: #{item.mtime} + div Last move: #{human_date(item.mtime)} if item.your_turn if item.time_left <= 0 div Time left: none. @@ -131,10 +131,10 @@ mixin gamelist(list,hide_title=0) else if item.time_left <= 5 div Time left: #{ item.time_left | 0 } days when 2 - div Finished: #{item.mtime} + div Finished: #{human_date(item.mtime)} div Result: !{item.result} when 3 - div Finished: #{item.mtime} + div Finished: #{human_date(item.mtime)} div Result: !{item.result} unless hide_title a(href=`/${item.title_id}`) -- cgit v1.2.3