diff --git a/make-pages/Date.hs b/make-pages/Date.hs index 7a5bb33..c2486b6 100644 --- a/make-pages/Date.hs +++ b/make-pages/Date.hs @@ -78,9 +78,12 @@ formatRSS = fromString . format . toTime where formatSlash :: Date -> Builder formatSlash (Date {year, month, day}) = case dayNum day of - Nothing -> [b|$year/$month|] - Just d -> [b|$year/$month/$d$q|] - where q = if exact day then "" else [b|?|] + Nothing -> [b|$year/$mm|] + Just d -> [b|$year/$mm/$dd$q|] where dd = pad2 d + where + mm = pad2 month + q = if exact day then "" else [b|?|] + pad2 x = let str = show x in if length str == 1 then '0':str else str nth :: Int -> Builder