gdritter repos activitystreams-aeson / master
Removed obsolete datetime dependency in favor of time Getty Ritter 10 years ago
3 changed file(s) with 12 addition(s) and 12 deletion(s). Collapse all Expand all
8484 , fromJSON
8585 )
8686 import qualified Data.Aeson as A
87 import Data.DateTime (DateTime)
87 import Data.Time.Clock (UTCTime)
8888 import qualified Data.HashMap.Strict as HM
8989 import Data.Text (Text)
9090
233233
234234 -- | The date and time at which the object was published. An object MAY
235235 -- contain a @published@ property.
236 oPublished :: Lens' Object (Maybe DateTime)
236 oPublished :: Lens' Object (Maybe UTCTime)
237237 oPublished = makeAesonLensMb "published" oRest
238238
239239 -- | Natural-language summarization of the object encoded as a single
244244
245245 -- | The date and time at which a previously published object has been
246246 -- modified. An Object MAY contain an @updated@ property.
247 oUpdated :: Lens' Object (Maybe DateTime)
247 oUpdated :: Lens' Object (Maybe UTCTime)
248248 oUpdated = makeAesonLensMb "updated" oRest
249249
250250 -- | A JSON Array of one or more absolute IRI's
333333
334334 -- | The date and time at which the activity was published. An activity
335335 -- MUST contain a @published@ property.
336 acPublished :: Lens' Activity DateTime
336 acPublished :: Lens' Activity UTCTime
337337 acPublished = makeAesonLens "published" acRest
338338
339339 -- | Describes the application that published the activity. Note that this
362362
363363 -- | The date and time at which a previously published activity has
364364 -- been modified. An Activity MAY contain an @updated@ property.
365 acUpdated :: Lens' Activity (Maybe DateTime)
365 acUpdated :: Lens' Activity (Maybe UTCTime)
366366 acUpdated = makeAesonLensMb "updated" acRest
367367
368368 -- | An IRI <http://www.ietf.org/rfc/rfc3987.txt RFC3987>
384384
385385 -- | Create an @Activity@ with an @actor@, @published@, and
386386 -- @provider@ property.
387 makeActivity :: Object -> DateTime -> Activity
387 makeActivity :: Object -> UTCTime -> Activity
388388 makeActivity actor published = Activity
389389 $ HM.insert "actor" (toJSON actor)
390390 $ HM.insert "published" (toJSON published)
8888
8989 import qualified Data.Aeson as Aeson
9090 import Data.Aeson.TH (deriveJSON)
91 import Data.DateTime (DateTime)
91 import Data.Time.Clock (UTCTime)
9292 import Data.Aeson ( FromJSON(..), ToJSON(..) )
9393 import qualified Data.HashMap.Strict as HM
9494 import Data.Text (Text)
698698
699699 -- | The date and time that the event ends represented as a String
700700 -- conforming to the "date-time" production in [RFC3339].
701 evEndTime :: Lens' Object (Maybe DateTime)
701 evEndTime :: Lens' Object (Maybe UTCTime)
702702 evEndTime = makeAesonLensMb "endTime" oRest
703703
704704 -- | A collection object as defined in Section 3.5 of the JSON
727727
728728 -- | The date and time that the event begins represented as a String
729729 -- confirming to the "date-time" production in RFC 3339.
730 evStartTime :: Lens' Object (Maybe DateTime)
730 evStartTime :: Lens' Object (Maybe UTCTime)
731731 evStartTime = makeAesonLensMb "startTime" oRest
732732
733733 -- issue
811811
812812 -- | A RFC 3339 date-time specifying the date and time by which the
813813 -- task is to be completed.
814 tsBy :: Lens' Object (Maybe DateTime)
814 tsBy :: Lens' Object (Maybe UTCTime)
815815 tsBy = makeAesonLensMb "by" oRest
816816
817817 -- | An Activity Streams object describing the object of the task.
11 name: activitystreams-aeson
2 version: 0.2.0.0
2 version: 0.2.0.1
33 synopsis: An interface to the ActivityStreams specification
44 description: An interface to the
55 <http://activitystrea.ms/ Activity Streams>
3232 build-depends: base >=4.7 && <4.8,
3333 aeson ==0.8.*,
3434 text >=1.1,
35 datetime ==0.2.*,
35 time >=1.4,
3636 unordered-containers >=0.2.5
3737 default-language: Haskell2010