fix(fill): minor testdata fixes
This commit is contained in:
parent
fb5cd5558c
commit
59a7e1ceb2
@ -58,9 +58,9 @@ fillDb = do
|
|||||||
|
|
||||||
(currentYear, currentMonth, _) = toGregorian $ utctDay now
|
(currentYear, currentMonth, _) = toGregorian $ utctDay now
|
||||||
currentTerm
|
currentTerm
|
||||||
| 3 <= currentMonth = TermIdentifier currentYear Q1
|
| 3 >= currentMonth = TermIdentifier currentYear Q1
|
||||||
| 6 <= currentMonth = TermIdentifier currentYear Q2
|
| 6 >= currentMonth = TermIdentifier currentYear Q2
|
||||||
| 9 <= currentMonth = TermIdentifier currentYear Q3
|
| 9 >= currentMonth = TermIdentifier currentYear Q3
|
||||||
| otherwise = TermIdentifier currentYear Q4
|
| otherwise = TermIdentifier currentYear Q4
|
||||||
nextTerm = succ currentTerm
|
nextTerm = succ currentTerm
|
||||||
prevTerm = pred currentTerm
|
prevTerm = pred currentTerm
|
||||||
@ -617,13 +617,15 @@ fillDb = do
|
|||||||
insert_ $ CourseEdit jost now fdf
|
insert_ $ CourseEdit jost now fdf
|
||||||
|
|
||||||
forM_ [(Monday)..Thursday] $ \td -> do
|
forM_ [(Monday)..Thursday] $ \td -> do
|
||||||
forM_ [(1::Int)..4] $ \tw -> do
|
forM_ [(1::Int)..(4*4)] $ \tw -> do
|
||||||
|
let firstTT = utctDay $ termTime True (season currentTerm) (toRational $ tw - 1) False td (toMorning)
|
||||||
|
secondTT = utctDay $ termTime True (season currentTerm) (toRational $ tw - 1) False (succ td) (toMorning)
|
||||||
tut1 <- insert Tutorial
|
tut1 <- insert Tutorial
|
||||||
{ tutorialName = CI.mk $ Text.pack $ "KW" ++ (show tw) ++ (take 3 $ show td)
|
{ tutorialName = CI.mk $ Text.pack $ "KW" ++ (show $ snd3 $ toWeekDate firstTT) ++ (take 3 $ show td)
|
||||||
, tutorialCourse = fdf
|
, tutorialCourse = fdf
|
||||||
, tutorialType = "Schulung"
|
, tutorialType = "Schulung"
|
||||||
, tutorialCapacity = Just 16
|
, tutorialCapacity = Just 16
|
||||||
, tutorialRoom = Just $ case tw of
|
, tutorialRoom = Just $ case tw `mod` 4 of
|
||||||
1 -> "A380"
|
1 -> "A380"
|
||||||
2 -> "B747"
|
2 -> "B747"
|
||||||
3 -> "MD11"
|
3 -> "MD11"
|
||||||
@ -633,12 +635,12 @@ fillDb = do
|
|||||||
{ occurrencesScheduled = Set.empty
|
{ occurrencesScheduled = Set.empty
|
||||||
, occurrencesExceptions = Set.fromList
|
, occurrencesExceptions = Set.fromList
|
||||||
[ ExceptOccur
|
[ ExceptOccur
|
||||||
{ exceptDay = utctDay $ termTime True (season currentTerm) (toRational $ tw - 1) False td (toMorning)
|
{ exceptDay = firstTT
|
||||||
, exceptStart = TimeOfDay 8 30 0
|
, exceptStart = TimeOfDay 8 30 0
|
||||||
, exceptEnd = TimeOfDay 16 0 0
|
, exceptEnd = TimeOfDay 16 0 0
|
||||||
}
|
}
|
||||||
, ExceptOccur
|
, ExceptOccur
|
||||||
{ exceptDay = utctDay $ termTime True (season currentTerm) (toRational $ tw - 1) False (succ td) (toMorning)
|
{ exceptDay = secondTT
|
||||||
, exceptStart = TimeOfDay 9 0 0
|
, exceptStart = TimeOfDay 9 0 0
|
||||||
, exceptEnd = TimeOfDay 16 0 0
|
, exceptEnd = TimeOfDay 16 0 0
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user