refactor(schedule-week): split TimeSlot module into types and definitions

This commit is contained in:
Sarah Vaupel 2020-10-28 18:42:50 +01:00
parent 145564cf77
commit dc4bbbd97b
2 changed files with 14 additions and 6 deletions

View File

@ -12,17 +12,13 @@ import Import
import Handler.Utils.DateTime (formatTimeRangeW)
import Utils.Schedule.Week.Types.TimeSlot
slotStep :: Int
slotStep = 2
data TimeSlot = TimeSlot
{ tsFrom :: TimeOfDay
, tsTo :: TimeOfDay -- end excluded
}
deriving (Eq, Ord, Show, Read, Generic, Typeable)
timeSlot :: Int -> TimeSlot
timeSlot h = TimeSlot{..} where
tsFrom = TimeOfDay h 0 0

View File

@ -0,0 +1,12 @@
module Utils.Schedule.Week.Types.TimeSlot
( TimeSlot(..)
) where
import Import.NoModel
data TimeSlot = TimeSlot
{ tsFrom :: TimeOfDay
, tsTo :: TimeOfDay -- end excluded
}
deriving (Eq, Ord, Show, Read, Generic, Typeable)