summaryrefslogtreecommitdiff
path: root/index.templ
diff options
context:
space:
mode:
Diffstat (limited to 'index.templ')
-rw-r--r--index.templ8
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>
}