refactor(schedule-week): split TimeSlot module into types and definitions
This commit is contained in:
parent
145564cf77
commit
dc4bbbd97b
@ -12,17 +12,13 @@ import Import
|
|||||||
|
|
||||||
import Handler.Utils.DateTime (formatTimeRangeW)
|
import Handler.Utils.DateTime (formatTimeRangeW)
|
||||||
|
|
||||||
|
import Utils.Schedule.Week.Types.TimeSlot
|
||||||
|
|
||||||
|
|
||||||
slotStep :: Int
|
slotStep :: Int
|
||||||
slotStep = 2
|
slotStep = 2
|
||||||
|
|
||||||
|
|
||||||
data TimeSlot = TimeSlot
|
|
||||||
{ tsFrom :: TimeOfDay
|
|
||||||
, tsTo :: TimeOfDay -- end excluded
|
|
||||||
}
|
|
||||||
deriving (Eq, Ord, Show, Read, Generic, Typeable)
|
|
||||||
|
|
||||||
timeSlot :: Int -> TimeSlot
|
timeSlot :: Int -> TimeSlot
|
||||||
timeSlot h = TimeSlot{..} where
|
timeSlot h = TimeSlot{..} where
|
||||||
tsFrom = TimeOfDay h 0 0
|
tsFrom = TimeOfDay h 0 0
|
||||||
|
|||||||
12
src/Utils/Schedule/Week/Types/TimeSlot.hs
Normal file
12
src/Utils/Schedule/Week/Types/TimeSlot.hs
Normal 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)
|
||||||
Reference in New Issue
Block a user