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 { for _, entry := range entries {
<article> <article>
<header> <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 := "" }} {{ website := "" }}
if !entry.HideWebsite { if !entry.HideWebsite {
{{ website = entry.Website }} {{ website = entry.Website }}
@ -52,7 +52,7 @@ templ Guestbook(captchaID, owner string, entries []*justguestbook.Entry, pageCou
if entry.Reply != nil { if entry.Reply != nil {
<div class="reply"> <div class="reply">
<header> <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> { 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> </header>
for _, line := range strings.Split(entry.Reply.Message, "\n") { for _, line := range strings.Split(entry.Reply.Message, "\n") {