diff --git a/src/internal/utils.go b/src/internal/utils.go index a1aa6fc..9db5ece 100644 --- a/src/internal/utils.go +++ b/src/internal/utils.go @@ -9,7 +9,6 @@ import ( "path/filepath" "regexp" "strings" - "time" ) func ReadConfig(file string, config interface{}) error { @@ -103,15 +102,6 @@ func HumanDuration(i int) string { return fmt.Sprintf("%d %s", i, w) } -// TimeDiff to return the number of seconds between this time and now -func TimeDiff(ts time.Time) int { - diff := int(time.Since(ts).Seconds()) - if diff < 0 { - return diff * -1 - } - return diff -} - func ReturnError(logger *slog.Logger, message string, err error) int { if err != nil { logger.Error(message, slog.Any("error", err)) diff --git a/src/server/server.go b/src/server/server.go index 165edab..137aa49 100644 --- a/src/server/server.go +++ b/src/server/server.go @@ -106,7 +106,6 @@ func (s *Server) Start() error { // Web pages funcs := template.FuncMap{ "HumanDuration": internal.HumanDuration, - "TimeDiff": internal.TimeDiff, "lower": strings.ToLower, "string": func(b []byte) string { return string(b) }, } diff --git a/src/server/templates/note.html b/src/server/templates/note.html index 571d43e..a7c93cd 100644 --- a/src/server/templates/note.html +++ b/src/server/templates/note.html @@ -19,18 +19,13 @@