1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-27 05:04: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 :: TimeUnit -> Text
showSingle tu = showSingle tu =
case tu of case tu of
Second -> "second" Second -> "s"
Minute -> "minute" Minute -> "m"
Hour -> "hour" Hour -> "h"
Day -> "day" Day -> "d"
Week -> "week" Week -> "w"
Month -> "month" Month -> "mo"
Year -> "year" Year -> "y"
showPlural :: TimeUnit -> Text showPlural :: TimeUnit -> Text
showPlural tu = showSingle tu `snoc` 's' showPlural tu = showSingle tu `snoc` 's'
showTimeUnit :: TimeUnit -> Int -> Text showTimeUnit :: TimeUnit -> Int -> Text
showTimeUnit tu 1 = showSingle tu showTimeUnit tu 1 = showSingle tu
showTimeUnit tu _ = showPlural tu showTimeUnit tu _ = showSingle tu
showTimeAgo :: TimeAgo -> Text showTimeAgo :: TimeAgo -> Text