X.P.OrgMode: Appropriately pad output time

The standard formatting for org is to left-pad single digits with a
zero; do that.
This commit is contained in:
slotThe
2021-06-13 17:09:59 +02:00
parent 1c6e6c808d
commit dea8d9dced

View File

@@ -226,7 +226,10 @@ data TimeOfDay = TimeOfDay Int Int
instance Show TimeOfDay where
show :: TimeOfDay -> String
show (TimeOfDay h m) = show h <> ":" <> show m <> if m <= 9 then "0" else ""
show (TimeOfDay h m) = pad h <> ":" <> pad m
where
pad :: Int -> String
pad n = (if n <= 9 then "0" else "") <> show n
-- | Type for specifying exactly which day one wants.
data Date