|
@ -39,7 +39,10 @@ getEdt conf@Config {..} opts = do |
|
|
(HTTP.getResponseBody cal_req) |
|
|
(HTTP.getResponseBody cal_req) |
|
|
dates <- readDate date |
|
|
dates <- readDate date |
|
|
tz <- DT.getTimeZone $ DT.UTCTime (head dates) $ DT.secondsToDiffTime 43200 |
|
|
tz <- DT.getTimeZone $ DT.UTCTime (head dates) $ DT.secondsToDiffTime 43200 |
|
|
let message = case cal of |
|
|
|
|
|
|
|
|
let |
|
|
|
|
|
message = |
|
|
|
|
|
case |
|
|
|
|
|
(case cal of |
|
|
Left _ -> "I don't know this group, alternatively ADE doesn't work" |
|
|
Left _ -> "I don't know this group, alternatively ADE doesn't work" |
|
|
Right (vcal@IT.VCalendar { IT.vcEvents = evm } : _, _) -> |
|
|
Right (vcal@IT.VCalendar { IT.vcEvents = evm } : _, _) -> |
|
|
TS.unlines |
|
|
TS.unlines |
|
@ -50,14 +53,22 @@ getEdt conf@Config {..} opts = do |
|
|
`TS.append` TS.pack (show d) |
|
|
`TS.append` TS.pack (show d) |
|
|
`TS.append` "**\n" |
|
|
`TS.append` "**\n" |
|
|
`TS.append` renderEvents tz (ev d) |
|
|
`TS.append` renderEvents tz (ev d) |
|
|
else "No classes for the selected dates" |
|
|
|
|
|
|
|
|
else "" |
|
|
) |
|
|
) |
|
|
$ dates |
|
|
$ dates |
|
|
where |
|
|
where |
|
|
ev :: DT.Day -> [IT.VEvent] |
|
|
ev :: DT.Day -> [IT.VEvent] |
|
|
ev d = |
|
|
ev d = |
|
|
sortOn IT.veDTStart . filter (inDate d) . map snd . Map.toList $ evm |
|
|
|
|
|
|
|
|
sortOn IT.veDTStart |
|
|
|
|
|
. filter (inDate d) |
|
|
|
|
|
. map snd |
|
|
|
|
|
. Map.toList |
|
|
|
|
|
$ evm |
|
|
_ -> "An unexpected error has occured" |
|
|
_ -> "An unexpected error has occured" |
|
|
|
|
|
) |
|
|
|
|
|
of |
|
|
|
|
|
"" -> "No classes for the selected period" |
|
|
|
|
|
s -> s |
|
|
return message |
|
|
return message |
|
|
where |
|
|
where |
|
|
group :: TS.Text |
|
|
group :: TS.Text |
|
|