mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-26 15: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 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
|
||||
|
|
Loading…
Reference in a new issue