From 834af86d5bcd3e7522ee5b1fe9b37edf91cea5fe Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Thu, 25 May 2023 10:55:44 +0100 Subject: [PATCH] fix(totals.py): correct handling of report end when it is available Signed-off-by: Ankur Sinha (Ankur Sinha Gmail) --- ext/totals.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/totals.py b/ext/totals.py index b05db418..8b6082d0 100755 --- a/ext/totals.py +++ b/ext/totals.py @@ -110,7 +110,8 @@ def calculate_totals(input_stream): if report_end_utc is not None: j[-1]["end"] = min(report_end_utc, datetime.datetime.strptime(j[-1]["end"], DATEFORMAT).replace(tzinfo=from_zone)).strftime(DATEFORMAT) else: - report_end = datetime.datetime.strptime(j[-1]["end"], DATEFORMAT).replace(tzinfo=from_zone) + report_end_utc = datetime.datetime.strptime(j[-1]["end"], DATEFORMAT).replace(tzinfo=from_zone) + report_end = report_end_utc.astimezone(tz=to_zone) else: if report_end_utc is not None: j[-1]["end"] = min(report_end_utc, datetime.datetime.now(tz=from_zone)).strftime(DATEFORMAT)