[due-eod] Set 23:59:59 only if current due is 00:00:00.

This commit is contained in:
Stanislav Nikitin 2022-07-27 18:00:01 +05:00
parent d2f71ccb52
commit 0cc9f8e6c0
Signed by: pztrn
GPG Key ID: 1E944A0F0568B550
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ task_data = json.loads(task_data_raw)
if "due" in task_data:
new_due_ts = datetime.datetime.strptime(task_data["due"], "%Y%m%dT%H%M%S%z").astimezone()
if new_due_ts.hour != 23 and new_due_ts.minute != 59 and new_due_ts.second != 59:
if new_due_ts.hour != 00 and new_due_ts.minute != 00 and new_due_ts.second != 00:
new_due_ts = new_due_ts.replace(hour = 23, minute = 59, second = 59)
task_data["due"] = new_due_ts.astimezone(tz = datetime.timezone.utc).strftime("%Y%m%dT%H%M%SZ")