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
|
||||
currentTerm
|
||||
| 3 <= currentMonth = TermIdentifier currentYear Q1
|
||||
| 6 <= currentMonth = TermIdentifier currentYear Q2
|
||||
| 9 <= currentMonth = TermIdentifier currentYear Q3
|
||||
| 3 >= currentMonth = TermIdentifier currentYear Q1
|
||||
| 6 >= currentMonth = TermIdentifier currentYear Q2
|
||||
| 9 >= currentMonth = TermIdentifier currentYear Q3
|
||||
| otherwise = TermIdentifier currentYear Q4
|
||||
nextTerm = succ currentTerm
|
||||
prevTerm = pred currentTerm
|
||||
@ -617,13 +617,15 @@ fillDb = do
|
||||
insert_ $ CourseEdit jost now fdf
|
||||
|
||||
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
|
||||
{ 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
|
||||
, tutorialType = "Schulung"
|
||||
, tutorialCapacity = Just 16
|
||||
, tutorialRoom = Just $ case tw of
|
||||
, tutorialRoom = Just $ case tw `mod` 4 of
|
||||
1 -> "A380"
|
||||
2 -> "B747"
|
||||
3 -> "MD11"
|
||||
@ -633,12 +635,12 @@ fillDb = do
|
||||
{ occurrencesScheduled = Set.empty
|
||||
, occurrencesExceptions = Set.fromList
|
||||
[ ExceptOccur
|
||||
{ exceptDay = utctDay $ termTime True (season currentTerm) (toRational $ tw - 1) False td (toMorning)
|
||||
{ exceptDay = firstTT
|
||||
, exceptStart = TimeOfDay 8 30 0
|
||||
, exceptEnd = TimeOfDay 16 0 0
|
||||
}
|
||||
, ExceptOccur
|
||||
{ exceptDay = utctDay $ termTime True (season currentTerm) (toRational $ tw - 1) False (succ td) (toMorning)
|
||||
{ exceptDay = secondTT
|
||||
, exceptStart = TimeOfDay 9 0 0
|
||||
, exceptEnd = TimeOfDay 16 0 0
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user