1
0

Change timedate format in a guestbook.

This commit is contained in:
Alexander Andreev 2024-09-15 15:09:55 +04:00
parent 917bd7e21e
commit 45d1a71229
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34

View File

@ -36,7 +36,7 @@ templ Guestbook(captchaID, owner string, entries []*justguestbook.Entry, pageCou
for _, entry := range entries {
<article>
<header>
{{ created_tz := util.ToClientTimezone(entry.Created, r).Format("Monday _2 January 2006 15:04:05 -07:00") }}
{{ created_tz := util.ToClientTimezone(entry.Created, r).Format("02.01.2006 15:04:05 -07:00") }}
{{ website := "" }}
if !entry.HideWebsite {
{{ website = entry.Website }}
@ -52,7 +52,7 @@ templ Guestbook(captchaID, owner string, entries []*justguestbook.Entry, pageCou
if entry.Reply != nil {
<div class="reply">
<header>
{{ reply_created_tz := util.ToClientTimezone(entry.Reply.Created, r).Format("Monday _2 January 2006 15:04:05 -07:00") }}
{{ reply_created_tz := util.ToClientTimezone(entry.Reply.Created, r).Format("02.01.2006 15:04:05 -07:00") }}
{ i18n.T(ctx, "guestbook.post.reply") } <span class="highlighted">{ owner }</span> { i18n.T(ctx, "guestbook.post.on") } <time datetime={ entry.Reply.Created.Format(time.RFC3339) }>{ reply_created_tz }</time>
</header>
for _, line := range strings.Split(entry.Reply.Message, "\n") {