Fix datetime calling

This commit is contained in:
Ville Ranki 2020-01-05 21:52:39 +02:00
parent 6cf40488d4
commit 9aa17e389e
1 changed files with 2 additions and 2 deletions

View File

@ -140,7 +140,7 @@ class MatrixModule:
await bot.send_html(room, f'{self.parse_date(start)} <a href="{event["htmlLink"]}">{event["summary"]}</a>', f'{self.parse_date(start)} {event["summary"]}') await bot.send_html(room, f'{self.parse_date(start)} <a href="{event["htmlLink"]}">{event["summary"]}</a>', f'{self.parse_date(start)} {event["summary"]}')
def list_upcoming(self, calid): def list_upcoming(self, calid):
startTime = datetime.datetime.utcnow() startTime = datetime.utcnow()
now = startTime.isoformat() + 'Z' now = startTime.isoformat() + 'Z'
events_result = self.service.events().list(calendarId=calid, timeMin=now, events_result = self.service.events().list(calendarId=calid, timeMin=now,
maxResults=10, singleEvents=True, maxResults=10, singleEvents=True,
@ -149,7 +149,7 @@ class MatrixModule:
return events return events
def list_today(self, calid): def list_today(self, calid):
startTime = datetime.datetime.utcnow() startTime = datetime.utcnow()
startTime = startTime.replace( startTime = startTime.replace(
hour=0, minute=0, second=0, microsecond=0) hour=0, minute=0, second=0, microsecond=0)
endTime = startTime + datetime.timedelta(hours=24) endTime = startTime + datetime.timedelta(hours=24)