From b85806f3ade16ec65a5fd17da95e1b286884edf2 Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Sun, 5 Apr 2026 02:00:13 +0000 Subject: [PATCH] fix: use room timezone in edit confirmation dates The edit confirmation was using time.localtime() (server timezone). Now uses datetime.fromtimestamp() with room's timezone. --- apps/telegram-bot/commands.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/telegram-bot/commands.py b/apps/telegram-bot/commands.py index aa0ec9d..7f09b42 100644 --- a/apps/telegram-bot/commands.py +++ b/apps/telegram-bot/commands.py @@ -462,18 +462,24 @@ async def cmd_update(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> None: changes.append(f"Link: {old_link} → {link}") if due_date_ts is not None: old_date = ( - time.strftime("%d %b %Y %H:%M", time.localtime(old_bounty.due_date_ts)) + datetime.fromtimestamp(old_bounty.due_date_ts, tz=tz).strftime( + "%d %b %Y %H:%M" + ) if old_bounty.due_date_ts else "(none)" ) - new_date = time.strftime("%d %b %Y %H:%M", time.localtime(due_date_ts)) + new_date = datetime.fromtimestamp(due_date_ts, tz=tz).strftime( + "%d %b %Y %H:%M" + ) changes.append(f"Date: {old_date} → {new_date}") if clear_link: old_link = old_bounty.link or "(none)" changes.append(f"Link: {old_link} → (cleared)") if clear_date: old_date = ( - time.strftime("%d %b %Y %H:%M", time.localtime(old_bounty.due_date_ts)) + datetime.fromtimestamp(old_bounty.due_date_ts, tz=tz).strftime( + "%d %b %Y %H:%M" + ) if old_bounty.due_date_ts else "(none)" )