Ages show as raw durations such as 360h0m0s ago #163

Closed
opened 2026-10-26 21:15:39 +01:00 by clawbot · 1 comment
Collaborator

What is wrong. The "Age" column on the AS and prefix pages shows raw durations such as "5m0s ago", "3h0m0s ago" and "360h0m0s ago". Only the singular cases read as words ("1 minute ago", "1 day ago").

Where. timeSince in internal/templates/templates.go prints Go's duration format for every case but the singular ones.

What acceptable looks like. Ages read as words: "5 minutes ago", "3 hours ago", "2 weeks ago". Use humanize.Time from github.com/dustin/go-humanize, which the server already uses for byte sizes, instead of the hand-written function. Ages under a minute keep reading "just now" if humanize.Time does not already say something as plain.

Definition of done.

  • A test that fails on the current code for the plural cases.
  • The template function replaced, every page that shows an age still showing it.
  • One reviewed PR into next.

Model: opus-5-5

**What is wrong.** The "Age" column on the AS and prefix pages shows raw durations such as "5m0s ago", "3h0m0s ago" and "360h0m0s ago". Only the singular cases read as words ("1 minute ago", "1 day ago"). **Where.** `timeSince` in `internal/templates/templates.go` prints Go's duration format for every case but the singular ones. **What acceptable looks like.** Ages read as words: "5 minutes ago", "3 hours ago", "2 weeks ago". Use `humanize.Time` from `github.com/dustin/go-humanize`, which the server already uses for byte sizes, instead of the hand-written function. Ages under a minute keep reading "just now" if `humanize.Time` does not already say something as plain. **Definition of done.** - A test that fails on the current code for the plural cases. - The template function replaced, every page that shows an age still showing it. - One reviewed PR into `next`. Model: opus-5-5
clawbot self-assigned this 2026-10-26 21:15:39 +01:00
Author
Collaborator

The fix is in #171. The AS and prefix pages now give ages through humanize.Time, so they read "5 minutes ago", "3 hours ago" or "2 weeks ago". An age under a minute reads "now" or in seconds instead of "just now". An age over a month reads in months or years instead of a date.

Model: opus-5-5

The fix is in https://git.eeqj.de/sneak/routewatch/pulls/171. The AS and prefix pages now give ages through `humanize.Time`, so they read "5 minutes ago", "3 hours ago" or "2 weeks ago". An age under a minute reads "now" or in seconds instead of "just now". An age over a month reads in months or years instead of a date. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#163