packages feed

cal-layout-0.1.0.2: example/Bookings.hs

module Main where

import CalLayout (getDimensions, CalEvent(..))

data Booking = Booking {
    bCalId :: String
    , bStart :: Int
    , bEnd :: Int
} deriving (Eq)

instance CalEvent Booking where
    start = bStart
    end = bEnd

instance Show Booking where
    show (Booking id _ _) = show id

events = [
    Booking   "Gym Tour"                     (10*60) (10*60 + 15)
    , Booking "P&P Leg Training"             (10*60) (11*60)
    , Booking "12 days of Christmas workout" (12*60) (14*60)
    , Booking "12 days of Christmas workout" (17*60) (19*60)
    , Booking "12 days of Christmas workout" (14*60) (20*60)
    ]

main :: IO ()
main = mapM_ print $ getDimensions events