diff --git a/app/Main.hs b/app/Main.hs index 63b96d7..4f7cc8a 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -10,7 +10,9 @@ import Control.Monad.Logger (runStderrLoggingT) import Control.Monad.Trans.Resource (runResourceT) import Data.ByteString.Lazy as BS import Data.List as List -import Data.Time.Clock.POSIX (posixSecondsToUTCTime) +import Data.Text as T +import Data.Time.Clock.POSIX (posixSecondsToUTCTime, utcTimeToPOSIXSeconds) +import Data.Time.Clock (nominalDiffTimeToSeconds) import Database.Persist.Postgresql (ConnectionPool, ConnectionString, SqlBackend, runMigration, runSqlPool, getPgInterval, withPostgresqlPool) import Debug.Trace (traceShow) import Session @@ -56,6 +58,8 @@ instance YesodPersist Souplesse where getCalendarR :: Handler Html getCalendarR = do + let fTime = T.pack . show . floor . utcTimeToPOSIXSeconds + fDur = T.pack . show . ceiling . nominalDiffTimeToSeconds . getPgInterval (formWidget, _) <- generateFormPost uploadForm sessions' <- runDB Session.recents defaultLayout @@ -65,8 +69,8 @@ getCalendarR = do
A calendar view goes here