fix padding in yyyy/mm/dd dates
This commit is contained in:
parent
28520eb443
commit
44c5b933b5
1 changed files with 6 additions and 3 deletions
|
@ -78,9 +78,12 @@ formatRSS = fromString . format . toTime where
|
||||||
|
|
||||||
formatSlash :: Date -> Builder
|
formatSlash :: Date -> Builder
|
||||||
formatSlash (Date {year, month, day}) = case dayNum day of
|
formatSlash (Date {year, month, day}) = case dayNum day of
|
||||||
Nothing -> [b|$year/$month|]
|
Nothing -> [b|$year/$mm|]
|
||||||
Just d -> [b|$year/$month/$d$q|]
|
Just d -> [b|$year/$mm/$dd$q|] where dd = pad2 d
|
||||||
where q = if exact day then "" else [b|<span class=q>?</span>|]
|
where
|
||||||
|
mm = pad2 month
|
||||||
|
q = if exact day then "" else [b|<span class=q>?</span>|]
|
||||||
|
pad2 x = let str = show x in if length str == 1 then '0':str else str
|
||||||
|
|
||||||
|
|
||||||
nth :: Int -> Builder
|
nth :: Int -> Builder
|
||||||
|
|
Loading…
Reference in a new issue