aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'client.go')
-rw-r--r--client.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/client.go b/client.go
index 79e4bb1..d45e72d 100644
--- a/client.go
+++ b/client.go
@@ -111,6 +111,10 @@ func timeToReadableLong(t time.Time) string {
return t.Format("01/02/06(Mon)03:04:05")
}
+func timeToUnix(t time.Time) string {
+ return fmt.Sprint(t.Unix())
+}
+
func IndexGet(w http.ResponseWriter, r *http.Request, db *sql.DB) {
t := template.Must(template.New("").Funcs(template.FuncMap{
"mod": mod,
@@ -259,6 +263,7 @@ func OutboxGet(w http.ResponseWriter, r *http.Request, db *sql.DB, collection Co
return i + j
},
"timeToReadableLong": timeToReadableLong,
+ "timeToUnix": timeToUnix,
"sub": sub}).ParseFiles("./static/main.html", "./static/nposts.html", "./static/top.html", "./static/bottom.html", "./static/posts.html"))
actor := collection.Actor
@@ -462,6 +467,7 @@ func PostGet(w http.ResponseWriter, r *http.Request, db *sql.DB) {
return template.HTML(link)
},
"timeToReadableLong": timeToReadableLong,
+ "timeToUnix": timeToUnix,
"sub": sub}).ParseFiles("./static/main.html", "./static/npost.html", "./static/top.html", "./static/bottom.html", "./static/posts.html"))
path := r.URL.Path