diff --git a/internal/web/templates/view.html b/internal/web/templates/view.html
index 78dfaf5..5b2ed1b 100644
--- a/internal/web/templates/view.html
+++ b/internal/web/templates/view.html
@@ -97,7 +97,7 @@
{{range .events}}
{{.ID}} |
- {{.Timestamp}} |
+ {{.Timestamp | formatTimestamp }} |
{{.EventType}} |
Editar
diff --git a/internal/web/utils.go b/internal/web/utils.go
index 1a68151..48f7cc0 100644
--- a/internal/web/utils.go
+++ b/internal/web/utils.go
@@ -57,6 +57,11 @@ func LoadTemplate(c echo.Context, templateName string, data interface{}) error {
funcs := template.FuncMap{
"date": FormatDate, // Asignamos la función FormatDate con el nombre "date"
"json": ToJson, // Agregamos la función ToJson con el nombre "json"
+ "formatTimestamp": func(t time.Time) string {
+ location, _ := time.LoadLocation("Europe/Madrid")
+ localTime := t.In(location)
+ return localTime.Format("2006-01-02 15:04 (MST)")
+ },
}
// Cargar las plantillas desde los directorios
|