mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
fix(totals.py): correct handling of report end when it is available
Signed-off-by: Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com>
This commit is contained in:
parent
99d18f42bb
commit
834af86d5b
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue