From e1bb1608a40c06685acf3fb4c63ca4b7cfb98607 Mon Sep 17 00:00:00 2001 From: Joel Lutz Date: Thu, 3 Nov 2022 08:23:29 -0500 Subject: [PATCH] Fixed time range calculation problem for getSyntheticSessionData --- backend/api/appd/AppDService.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/api/appd/AppDService.py b/backend/api/appd/AppDService.py index 4e17c7f..53ecdc5 100644 --- a/backend/api/appd/AppDService.py +++ b/backend/api/appd/AppDService.py @@ -988,9 +988,9 @@ async def getSyntheticSessionData(self, applicationId: int, jobsJson: List[dict] # get the last 24 hours in milliseconds lastMonth = self.endTime - (1 * 60 * 60 * 24 * 30 * 1000) monthStart = datetime.timestamp(datetime.today().replace(day=1, hour=0, minute=0, second=0, microsecond=0)) + ws = (date.today() - timedelta(date.today().weekday())) weekStart = datetime.timestamp( - datetime.today().replace(day=(date.today() - timedelta(date.today().weekday())).day, hour=0, minute=0, second=0, microsecond=0) - ) + datetime.today().replace(year=ws.year, month=ws.month, day=ws.day, hour=0, minute=0, second=0, microsecond=0)) body = { "appId": applicationId, "scheduleIds": jobsJson,