Permalink
Browse files

Add conditional import from @23Skidoo's PR #12

  • Loading branch information...
1 parent e362c7d commit 01a538e1885c9756cda6f65d231b9cdcad21827e @mightybyte mightybyte committed Jul 4, 2016
Showing with 7 additions and 2 deletions.
  1. +1 −1 src/Snap/StaticPages.hs
  2. +6 −1 src/Snap/StaticPages/Internal/Time.hs
View
@@ -68,7 +68,7 @@ staticPagesInit s p = makeSnaplet "static-pages" desc Nothing $ do
liftIO $ readConfig configFilePath
cmap <- liftIO $ buildContentMap baseURL contentDir
-
+
addTemplatesAt s "" pth
addRoutes [ ("", serveStaticPages) ]
@@ -1,8 +1,13 @@
+{-# LANGUAGE CPP #-}
+
module Snap.StaticPages.Internal.Time where
import Data.Time
import Text.Printf
+#if !MIN_VERSION_time(1,5,0)
+import System.Locale
+#endif
formatAtomTime :: TimeZone -> UTCTime -> String
formatAtomTime tz = fmt . utcToLocalTime tz
@@ -22,4 +27,4 @@ parseAtomTime s = parseTimeOrError True defaultTimeLocale "%Y-%m-%dT%H:%M:%S%Z"
friendlyTime :: ZonedTime -> String
friendlyTime t = formatTime defaultTimeLocale "%b %e, %Y" t
-
+

0 comments on commit 01a538e

Please sign in to comment.