From 5ae10b7648f1db045d40adb63132583c97388289 Mon Sep 17 00:00:00 2001 From: Matthias Bilger Date: Wed, 1 May 2019 21:29:32 +0200 Subject: [PATCH] use whole school year --- infomentor/connector.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/infomentor/connector.py b/infomentor/connector.py index f00190e..38372a4 100644 --- a/infomentor/connector.py +++ b/infomentor/connector.py @@ -301,6 +301,14 @@ class Infomentor(object): def get_calendar(self, offset=0, weeks=1): self.logger.info('fetching calendar') data = self._get_week_dates(offset=offset, weeks=weeks) + data = { + 'UTCOffset': utcoffset, + } + schoolyear = int(startofweek.strftime('%Y')) + if int(startofweek.strftime('%m')) <= 7: + schoolyear -= 1 + data['start'] = '{}-08-01'.format(schoolyear) + data['end'] = '{}-07-31'.format(schoolyear+1) self._do_post( self._mim_url('Calendar/Calendar/getEntries'), data=data