mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-27 20:24:50 +09:00
chore: use compact time units (e.g., seconds -> s)
This commit is contained in:
parent
7b61749198
commit
deb19783b3
1 changed files with 8 additions and 8 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue