{-# LANGUAGE FlexibleContexts #-} module Villefort.Util (getHeader ,makeRow ,makeTable ,D(..) ,unpackStringToDate ,getDay ,getDateD ,getDate ,total) where import Control.Monad.Reader (MonadReader,MonadIO,liftIO) import Villefort.Definitions (VConfig(..)) import Paths_Villefort (getDataFileName) import Data.List (intercalate) import Data.Time (Day(..),fromGregorian,getZonedTime) import Data.Time.Calendar.OrdinalDate (mondayStartWeek) import Data.List.Split as S (splitOn) -- | Returns header of Villefortx getHeader :: (MonadReader VConfig m, MonadIO m) => m String getHeader = do headerPath <- liftIO $ getDataFileName "templates/header" liftIO $ readFile headerPath -- | Helper function to generate row of table makeRow :: [String] -> String makeRow x = "