def age_text

cswap-bend-cli@0.1.0.0 · render.bend:167

import cswap-bend-cli@0.1.0.0/render.bend as Render
import Base
import cswap-bend-cli@0.1.0.0/clock.bend as Clock

167def age_text(+secs: U32) -> String:
168  Clock.sel.s(U32.is_lt(secs, 60), "just now", Clock.sel.s(U32.is_lt(secs, 3600), U32.show((secs / 60 : U32)) ++ "m ago",
169    Clock.sel.s(U32.is_lt(secs, 86400), U32.show((secs / 3600 : U32)) ++ "h ago", U32.show((secs / 86400 : U32)) ++ "d ago")))

Uses (7)

Used by (2)