From 8b0300c738185a02be6176bf0e21367ab9f7412d Mon Sep 17 00:00:00 2001 From: jabuxas Date: Wed, 16 Oct 2024 22:19:47 -0300 Subject: [PATCH] feat: add timeUploaded to /tree --- handlers.go | 3 +++ templates/dirlist.html | 2 ++ 2 files changed, 5 insertions(+) diff --git a/handlers.go b/handlers.go index ca80979..40fdd5e 100644 --- a/handlers.go +++ b/handlers.go @@ -47,6 +47,9 @@ func (app *Application) fileListingHandler(w http.ResponseWriter, r *http.Reques Path: filepath.Join(r.URL.Path, file.Name()), Size: info.Size(), FormattedSize: FormatFileSize(info.Size()), + TimeUploaded: info.ModTime(). + UTC(). + Format("2006-01-02 15:04:05 UTC"), }) } diff --git a/templates/dirlist.html b/templates/dirlist.html index cdedd1a..31204ce 100644 --- a/templates/dirlist.html +++ b/templates/dirlist.html @@ -68,6 +68,7 @@ Name + Time Uploaded Size @@ -77,6 +78,7 @@ {{.Name}} + {{.TimeUploaded}} {{.FormattedSize}} {{end}}