1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-27 04:24:51 +09:00

chore: use compact time units (e.g., seconds -> s)

This commit is contained in:
naskya 2023-12-01 05:27:32 +09:00
parent 7b61749198
commit deb19783b3
Signed by: naskya
GPG key ID: 164DFF24E2D40139

View file

@ -269,20 +269,20 @@ class SpecToEventTime s where
showSingle :: TimeUnit -> Text
showSingle tu =
case tu of
Second -> "second"
Minute -> "minute"
Hour -> "hour"
Day -> "day"
Week -> "week"
Month -> "month"
Year -> "year"
Second -> "s"
Minute -> "m"
Hour -> "h"
Day -> "d"
Week -> "w"
Month -> "mo"
Year -> "y"
showPlural :: TimeUnit -> Text
showPlural tu = showSingle tu `snoc` 's'
showTimeUnit :: TimeUnit -> Int -> Text
showTimeUnit tu 1 = showSingle tu
showTimeUnit tu _ = showPlural tu
showTimeUnit tu _ = showSingle tu
showTimeAgo :: TimeAgo -> Text