From 191e2ddf095a5e57b33caf4a9235c686a462232c Mon Sep 17 00:00:00 2001 From: Samuel Wilhelmsson Date: Mon, 1 Apr 2024 17:11:50 +0200 Subject: render time as sweden --- index.templ | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'index.templ') diff --git a/index.templ b/index.templ index 28fb754..23c389a 100644 --- a/index.templ +++ b/index.templ @@ -4,7 +4,7 @@ import "fmt" import "time" import "net/url" -templ index(ps []Post) { +templ index(ps []Post, tz *time.Location) { @@ -21,7 +21,7 @@ templ index(ps []Post) {

Tinygram

- @posts(ps) + @posts(ps, tz)
@@ -88,7 +88,7 @@ templ uploadPage(csrfToken string) { } -templ posts(posts []Post) { +templ posts(posts []Post, tz *time.Location) { for _, post := range posts {
@@ -96,7 +96,7 @@ templ posts(posts []Post) {

{ post.Description }

-

{ post.CreatedAt.Format("2006-01-02 - 15:04") }

+

{ post.CreatedAt.In(tz).Format("2006-01-02 - 15:04") }

} -- cgit v1.2.3