* changed comment structure to sort by UTCTime

* postEntry function done; adminHandler doesn't work?
This commit is contained in:
Vincent Ambo 2012-03-14 00:37:00 +01:00
parent f6446aec72
commit e6746984f5
5 changed files with 121 additions and 44 deletions

View file

@ -54,10 +54,10 @@ instance Show BlogLang where
$(deriveSafeCopy 0 'base ''BlogLang)
data Comment = Comment { 
data Comment = Comment {
cdate :: UTCTime,
cauthor :: Text,
ctext :: Text,
cdate :: UTCTime
ctext :: Text
} deriving (Eq, Ord, Show, Data, Typeable)
$(deriveSafeCopy 0 'base ''Comment)
@ -203,7 +203,7 @@ instance JSON Comment where
jsscdate <- jsonField "cdate" obj :: Result JSValue
let rcdate = stripResult $ jsonInt jsscdate
sctext <- jsonField "ctext" obj
return $ Comment (pack scauthor) (pack sctext) (parseSeconds rcdate)
return $ Comment (parseSeconds rcdate) (pack scauthor) (pack sctext)
instance JSON Entry where
showJSON = undefined