-- System imports.
import Control.Monad ( forM_, join )
-import Data.Time ( UTCTime )
+import Data.Time ( UTCTime(..) )
import Data.Tuple.Curry ( uncurryN )
import Database.Groundhog (
(=.),
data OddsGame =
OddsGame {
db_game_id :: Int,
- db_game_date :: UTCTime,
- db_game_time :: UTCTime,
+ db_game_time :: UTCTime, -- ^ Contains both the date and time.
db_game_away_team_rotation_number :: Int,
db_game_home_team_rotation_number :: Int }
deriving (Eq, Show)
data OddsGameXml =
OddsGameXml {
xml_game_id :: Int,
- xml_game_date :: UTCTime,
- xml_game_time :: UTCTime,
+ xml_game_date :: UTCTime, -- ^ Contains only the date
+ xml_game_time :: UTCTime, -- ^ Contains only the time
xml_game_away_team :: OddsGameAwayTeamXml,
xml_game_home_team :: OddsGameHomeTeamXml,
xml_game_over_under :: OddsGameOverUnderXml }
from_xml OddsGameXml{..} =
OddsGame {
db_game_id = xml_game_id,
- db_game_date = xml_game_date,
- db_game_time = xml_game_time,
+
+ db_game_time = UTCTime
+ (utctDay xml_game_date) -- Take the day part from one,
+ (utctDayTime xml_game_time), -- the time from the other.
+
db_game_away_team_rotation_number =
(xml_away_rotation_number xml_game_away_team),
+
db_game_home_team_rotation_number =
(xml_home_rotation_number xml_game_home_team) }