Просмотр исходного кода

Removed obsolete datetime dependency in favor of time

Getty Ritter 10 лет назад
Родитель
Сommit
b48b370eb1

+ 6 - 6
Codec/ActivityStream/Representation.hs

@@ -84,7 +84,7 @@ import           Data.Aeson ( FromJSON(..)
                             , fromJSON
                             )
 import qualified Data.Aeson as A
-import           Data.DateTime (DateTime)
+import           Data.Time.Clock (UTCTime)
 import qualified Data.HashMap.Strict as HM
 import           Data.Text (Text)
 
@@ -233,7 +233,7 @@ oObjectType = makeAesonLensMb "objectType" oRest
 
 -- | The date and time at which the object was published. An object MAY
 --   contain a @published@ property.
-oPublished :: Lens' Object (Maybe DateTime)
+oPublished :: Lens' Object (Maybe UTCTime)
 oPublished = makeAesonLensMb "published" oRest
 
 -- | Natural-language summarization of the object encoded as a single
@@ -244,7 +244,7 @@ oSummary = makeAesonLensMb "summary" oRest
 
 -- | The date and time at which a previously published object has been
 --   modified. An Object MAY contain an @updated@ property.
-oUpdated :: Lens' Object (Maybe DateTime)
+oUpdated :: Lens' Object (Maybe UTCTime)
 oUpdated = makeAesonLensMb "updated" oRest
 
 -- | A JSON Array of one or more absolute IRI's
@@ -333,7 +333,7 @@ acObject = makeAesonLensMb "object" acRest
 
 -- | The date and time at which the activity was published. An activity
 --   MUST contain a @published@ property.
-acPublished :: Lens' Activity DateTime
+acPublished :: Lens' Activity UTCTime
 acPublished = makeAesonLens "published" acRest
 
 -- | Describes the application that published the activity. Note that this
@@ -362,7 +362,7 @@ acTitle = makeAesonLensMb "title" acRest
 
 -- | The date and time at which a previously published activity has
 --   been modified. An Activity MAY contain an @updated@ property.
-acUpdated :: Lens' Activity (Maybe DateTime)
+acUpdated :: Lens' Activity (Maybe UTCTime)
 acUpdated = makeAesonLensMb "updated" acRest
 
 -- | An IRI <http://www.ietf.org/rfc/rfc3987.txt RFC3987>
@@ -384,7 +384,7 @@ acVerb = makeAesonLensMb "verb" acRest
 
 -- | Create an @Activity@ with an @actor@, @published@, and
 --   @provider@ property.
-makeActivity :: Object -> DateTime -> Activity
+makeActivity :: Object -> UTCTime -> Activity
 makeActivity actor published = Activity
   $ HM.insert "actor"     (toJSON actor)
   $ HM.insert "published" (toJSON published)

+ 4 - 4
Codec/ActivityStream/Schema.hs

@@ -88,7 +88,7 @@ module Codec.ActivityStream.Schema
 
 import qualified Data.Aeson as Aeson
 import           Data.Aeson.TH (deriveJSON)
-import           Data.DateTime (DateTime)
+import           Data.Time.Clock (UTCTime)
 import           Data.Aeson ( FromJSON(..), ToJSON(..) )
 import qualified Data.HashMap.Strict as HM
 import           Data.Text (Text)
@@ -698,7 +698,7 @@ evAttending = makeAesonLensMb "attending" oRest
 
 -- | The date and time that the event ends represented as a String
 -- conforming to the "date-time" production in [RFC3339].
-evEndTime :: Lens' Object (Maybe DateTime)
+evEndTime :: Lens' Object (Maybe UTCTime)
 evEndTime = makeAesonLensMb "endTime" oRest
 
 -- | A collection object as defined in Section 3.5 of the JSON
@@ -727,7 +727,7 @@ evNotAttending = makeAesonLensMb "notAttending" oRest
 
 -- | The date and time that the event begins represented as a String
 -- confirming to the "date-time" production in RFC 3339.
-evStartTime :: Lens' Object (Maybe DateTime)
+evStartTime :: Lens' Object (Maybe UTCTime)
 evStartTime = makeAesonLensMb "startTime" oRest
 
 -- issue
@@ -811,7 +811,7 @@ tsActor = makeAesonLensMb "actor" oRest
 
 -- | A RFC 3339 date-time specifying the date and time by which the
 -- task is to be completed.
-tsBy :: Lens' Object (Maybe DateTime)
+tsBy :: Lens' Object (Maybe UTCTime)
 tsBy = makeAesonLensMb "by" oRest
 
 -- | An Activity Streams object describing the object of the task.

+ 2 - 2
activitystreams-aeson.cabal

@@ -1,5 +1,5 @@
 name:                activitystreams-aeson
-version:             0.2.0.0
+version:             0.2.0.1
 synopsis:            An interface to the ActivityStreams specification
 description:         An interface to the
                      <http://activitystrea.ms/ Activity Streams>
@@ -32,6 +32,6 @@ library
   build-depends:       base                 >=4.7 && <4.8,
                        aeson                ==0.8.*,
                        text                 >=1.1,
-                       datetime             ==0.2.*,
+                       time                 >=1.4,
                        unordered-containers >=0.2.5
   default-language:    Haskell2010