feat: improve display of indexing times and durations
Alan Pearce alan@alanpearce.eu
Sun, 23 Mar 2025 12:49:46 +0100
1 files changed, 7 insertions(+), 7 deletions(-)
M internal/components/search.go → internal/components/search.go
@@ -45,7 +45,7 @@ P(Class("notice"), g.Text("Indexing in progress, started "), Time( DateTime(Indexing.StartedAt.Format(time.RFC3339)), - Title(Indexing.StartedAt.Format(time.RFC3339)), + Title(Indexing.StartedAt.Format(time.DateTime)), g.Text(time.Since(Indexing.StartedAt).Round(time.Second).String()), ), g.Text(" ago. "), @@ -53,7 +53,7 @@ g.If(!Indexing.FinishedAt.IsZero(), g.Text("Last run took "), Time( DateTime(Indexing.FinishedAt.Format(time.RFC3339)), - Title(Indexing.FinishedAt.Format(time.RFC3339)), + Title(Indexing.FinishedAt.Format(time.DateTime)), g.Text(time.Since(Indexing.FinishedAt).Round(time.Minute).String()), ), ), @@ -62,14 +62,14 @@ P( g.Text("Indexing last ran "), Time( DateTime(Indexing.FinishedAt.Format(time.RFC3339)), - Title(Indexing.FinishedAt.Format(time.RFC3339)), - g.Text(time.Since(Indexing.FinishedAt).Round(time.Minute).String()), + Title(Indexing.FinishedAt.Format(time.DateTime)), + g.Textf("%.0f hours ago", time.Since(Indexing.FinishedAt).Hours()), ), - g.Text(" ago, will run again in "), + g.Text(", will run again in "), Time( DateTime(Indexing.NextRun.Format(time.RFC3339)), - Title(Indexing.NextRun.Format(time.RFC3339)), - g.Text(time.Until(Indexing.NextRun).Round(time.Minute).String()), + Title(Indexing.NextRun.Format(time.DateTime)), + g.Textf("%.0f hours", time.Until(Indexing.NextRun).Hours()), ), g.Text("."), ),