git.iko.soy/typeable/extra-time
on master help sign in
B2H-746: Make packages compatible with vanila reflex-platform (#6092)
commit1976e842bea10473dab36bb772ff0a57079fc152 authorVladislav Lagunov <vlad.lagunoff@gmail.com> dateWed 2 Jun 2021, 11:55 (5 years ago) parent28ec1ce
2 files changed+10−3
extra-time.cabal+4−2 src/Data/Time/Fmt.hs+6−1
extra-time.cabal+4−2
@@ -33,14 +33,16 @@ library
3333 time,
3434 -- | from hackage
3535 aeson ,
36− dom-parser ,
3736 generic-arbitrary ,
3837 http-api-data ,
3938 lens >= 4.17 ,
4039 QuickCheck ,
4140 quickcheck-instances ,
4241 timezone-series ,
43− xml-conduit-writer ,
42+ if !impl(ghcjs)
43+ build-depends:
44+ dom-parser ,
45+ xml-conduit-writer ,
4446 exposed-modules:
4547 Data.Time.Extra
4648 Data.Time.Fmt
src/Data/Time/Fmt.hs+6−1
@@ -24,9 +24,12 @@ import Data.Time
2424import GHC.Generics (Generic)
2525import GHC.TypeLits
2626import Test.QuickCheck
27+import Web.HttpApiData
28+
29+#ifndef ghcjs_HOST_OS
2730import Text.XML.DOM.Parser
2831import Text.XML.Writer
29−import Web.HttpApiData
32+#endif
3033
3134#if !MIN_VERSION_base(4,13,0)
3235import Control.Monad.Fail
@@ -82,6 +85,7 @@ instance (ParseTime a, KnownSymbol fmt) => FromHttpApiData (FmtTime fmt a) where
8285 parseUrlPiece t =
8386 maybe (Left $ errParseFmtTime @fmt t) Right $ fmtTimeFromString $ T.unpack t
8487
88+#ifndef ghcjs_HOST_OS
8589instance (FormatTime a, KnownSymbol fmt) => ToXML (FmtTime fmt a) where
8690 toXML = toXML . T.pack . fmtTimeToString
8791
@@ -90,6 +94,7 @@ instance (ParseTime a, KnownSymbol fmt) => FromDom (FmtTime fmt a) where
9094 s <- fromDom
9195 maybe (throwParserError $ PEContentWrongFormat $ errParseFmtTime @fmt s)
9296 pure $ fmtTimeFromString $ T.unpack s
97+#endif
9398
9499type ZonedISO8601 = ("%FT%T%Q%z" :: Symbol)
95100