@@ -172,18 +172,23 @@ renderDateFieldWith locale key format defaultValue page =
172getUTCMaybe :: TimeLocale -- ^ Output time locale
172getUTCMaybe :: TimeLocale -- ^ Output time locale
173 -> Page a -- ^ Input page
173 -> Page a -- ^ Input page
174 -> Maybe UTCTime -- ^ Parsed UTCTime
174 -> Maybe UTCTime -- ^ Parsed UTCTime
175−getUTCMaybe locale page = msum
175+getUTCMaybe locale page = msum $
176− [ fromPublished "%a, %d %b %Y %H:%M:%S UT"
176+ [fromField "published" fmt | fmt <- formats] ++
177− , fromPublished "%Y-%m-%dT%H:%M:%SZ"
177+ [fromField "date" fmt | fmt <- formats] ++
178− , fromPublished "%Y-%m-%d %H:%M:%S"
179− , fromPublished "%B %e, %Y %l:%M %p"
180− , fromPublished "%B %e, %Y"
181− , getFieldMaybe "path" page >>= parseTime' "%Y-%m-%d" .
178+ [ getFieldMaybe "path" page >>= parseTime' "%Y-%m-%d" .
182 intercalate "-" . take 3 . splitAll "-" . takeFileName
179 intercalate "-" . take 3 . splitAll "-" . takeFileName
185− fromPublished f = getFieldMaybe "published" page >>= parseTime' f
186 parseTime' f str = parseTime locale f str
182 parseTime' f str = parseTime locale f str
183+ fromField k fmt = getFieldMaybe k page >>= parseTime' fmt
186+ [ "%a, %d %b %Y %H:%M:%S UT"
187+ , "%Y-%m-%dT%H:%M:%SZ"
188+ , "%Y-%m-%d %H:%M:%S"
189+ , "%B %e, %Y %l:%M %p"
188-- | Set the modification time as a field in the page
193-- | Set the modification time as a field in the page
189renderModificationTime :: String
194renderModificationTime :: String