Monorepo for Tangled tangled.org

appview/pages: special-case for sub-second times in timeAgo formats #568

merged opened by oppi.li targeting master from push-wsxnywmtsnrp

when time is formatted in "timeago" formats, it can be displayed as "edited now ago" when the time is sub-second. this case is now specialized to omit the "ago" to result in "edited now".

Signed-off-by: oppiliappan me@oppi.li

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:qfpnj4og54vl56wngdriaxug/sh.tangled.repo.pull/3lyhvgqh7qv22
+6 -1
Diff #0
+6 -1
appview/pages/templates/repo/fragments/shortTimeAgo.html
··· 1 1 {{ define "repo/fragments/shortTimeAgo" }} 2 - {{ template "repo/fragments/timeWrapper" (dict "Time" . "Content" (print (. | shortRelTimeFmt) " ago")) }} 2 + {{ $formatted := shortRelTimeFmt . }} 3 + {{ $content := printf "%s ago" $formatted }} 4 + {{ if eq $formatted "now" }} 5 + {{ $content = "now" }} 6 + {{ end }} 7 + {{ template "repo/fragments/timeWrapper" (dict "Time" . "Content" $content) }} 3 8 {{ end }} 4 9

History

1 round 0 comments
sign up or login to add to the discussion
oppi.li submitted #0
1 commit
expand
appview/pages: special-case for sub-second times in timeAgo formats
expand 0 comments
pull request successfully merged