diff options
| author | Samuel Wilhelmsson <samuel.wilhelmsson@gmail.com> | 2024-04-01 17:11:50 +0200 |
|---|---|---|
| committer | Samuel Wilhelmsson <samuel.wilhelmsson@gmail.com> | 2024-11-14 09:27:54 +0000 |
| commit | 191e2ddf095a5e57b33caf4a9235c686a462232c (patch) | |
| tree | 183e0dab0166d32a33e6179d7d4a0221007e20a0 /index.templ | |
| parent | 9e8b98891bc6446532bd8be203a4aadf30f326be (diff) | |
| download | tinygram-191e2ddf095a5e57b33caf4a9235c686a462232c.tar.gz tinygram-191e2ddf095a5e57b33caf4a9235c686a462232c.zip | |
render time as sweden
Diffstat (limited to 'index.templ')
| -rw-r--r-- | index.templ | 8 |
1 files changed, 4 insertions, 4 deletions
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) { <!DOCTYPE html> <html> <head> @@ -21,7 +21,7 @@ templ index(ps []Post) { <a id="uploadlink" href="/upload"><h2>Tinygram</h2></a> </div> <div id="posts"> - @posts(ps) + @posts(ps, tz) </div> </div> </body> @@ -88,7 +88,7 @@ templ uploadPage(csrfToken string) { </html> } -templ posts(posts []Post) { +templ posts(posts []Post, tz *time.Location) { for _, post := range posts { <div class="post"> <div class="imgcontainer"> @@ -96,7 +96,7 @@ templ posts(posts []Post) { </div> <div class="summary"> <p class="description">{ post.Description }</p> - <p class="date">{ post.CreatedAt.Format("2006-01-02 - 15:04") }</p> + <p class="date">{ post.CreatedAt.In(tz).Format("2006-01-02 - 15:04") }</p> </div> </div> } |
