Moved formatW3 to web-encodings package
This commit is contained in:
parent
a607da06d3
commit
7df28f4f30
@ -40,7 +40,7 @@ import Data.Object
|
||||
import qualified Data.ByteString.Lazy as B
|
||||
import Data.Object.Instances
|
||||
|
||||
import Web.Restful.Utils (formatW3)
|
||||
import Web.Encodings (formatW3)
|
||||
|
||||
import Test.Framework (testGroup, Test)
|
||||
|
||||
|
||||
@ -18,7 +18,6 @@ module Web.Restful.Response.AtomFeed
|
||||
) where
|
||||
|
||||
import Web.Restful.Response
|
||||
import Web.Restful.Utils
|
||||
|
||||
import Data.Time.Clock
|
||||
import Web.Encodings
|
||||
|
||||
@ -21,7 +21,6 @@ module Web.Restful.Response.Sitemap
|
||||
|
||||
import Web.Restful.Handler
|
||||
import Web.Restful.Response
|
||||
import Web.Restful.Utils
|
||||
import Web.Encodings
|
||||
import qualified Hack
|
||||
import Web.Restful.Request
|
||||
|
||||
@ -15,17 +15,12 @@
|
||||
module Web.Restful.Utils
|
||||
( parseHttpAccept
|
||||
, tryLookup
|
||||
, formatW3
|
||||
, testSuite
|
||||
) where
|
||||
|
||||
import Data.List.Split (splitOneOf)
|
||||
import Data.Maybe (fromMaybe)
|
||||
|
||||
import Data.Time.Clock
|
||||
import System.Locale
|
||||
import Data.Time.Format
|
||||
|
||||
import Test.Framework (testGroup, Test)
|
||||
import Test.Framework.Providers.HUnit
|
||||
import Test.HUnit hiding (Test)
|
||||
@ -43,10 +38,6 @@ specialHttpAccept _ = False
|
||||
tryLookup :: Eq k => v -> k -> [(k, v)] -> v
|
||||
tryLookup def key = fromMaybe def . lookup key
|
||||
|
||||
-- | Format a 'UTCTime' in W3 format; useful for setting cookies.
|
||||
formatW3 :: UTCTime -> String
|
||||
formatW3 = formatTime defaultTimeLocale "%FT%X-00:00"
|
||||
|
||||
----- Testing
|
||||
testSuite :: Test
|
||||
testSuite = testGroup "Web.Restful.Response"
|
||||
|
||||
@ -29,8 +29,8 @@ library
|
||||
bytestring-class,
|
||||
web-encodings >= 0.0.1,
|
||||
mtl >= 1.1.0.2,
|
||||
data-object,
|
||||
yaml >= 0.0.1,
|
||||
data-object >= 0.0.2,
|
||||
yaml >= 0.0.4,
|
||||
test-framework,
|
||||
test-framework-quickcheck,
|
||||
test-framework-hunit,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user