summaryrefslogtreecommitdiff
path: root/Command/ImportFeed.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-04-21 00:37:14 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-04-21 00:37:14 -0400
commit67ba0c356656b60fab8520866520ee7aefdc94fb (patch)
tree1d9d68e5d5d628b5a00ebc27306b1a8fe872b45a /Command/ImportFeed.hs
parentdbc01939f3da3653df51f1fe8b2d5da891ea8828 (diff)
allow building with old feed lib, w/o pubdate
Diffstat (limited to 'Command/ImportFeed.hs')
-rw-r--r--Command/ImportFeed.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/Command/ImportFeed.hs b/Command/ImportFeed.hs
index 80e59b739..29f2fb148 100644
--- a/Command/ImportFeed.hs
+++ b/Command/ImportFeed.hs
@@ -224,11 +224,15 @@ feedFile tmpl i extension = Utility.Format.format tmpl $ M.fromList
fieldMaybe k Nothing = (k, "none")
fieldMaybe k (Just v) = field k v
+#if MIN_VERSION_feed(0,3,9)
pubdate itm = case getItemPublishDate itm :: Maybe (Maybe UTCTime) of
Just (Just d) -> Just $
formatTime defaultTimeLocale "%F" d
-- if date cannot be parsed, use the raw string
_ -> replace "/" "-" <$> getItemPublishDateString itm
+#else
+ pubdate _ = Nothing
+#endif
{- Called when there is a problem with a feed.
- Throws an error if the feed is broken, otherwise shows a warning. -}