ops: dates shown as DD.MM.YYYY (bot, digest, reminders, BroV)
Storage and the API stay ISO; ru_day() formats every user-facing date, Claude is asked to write dates in its replies the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+5
-3
@@ -2,6 +2,8 @@
|
||||
from datetime import date
|
||||
from html import escape
|
||||
|
||||
from .core import ru_day
|
||||
|
||||
ICON = {"task": "📌", "sub": "💳", "routine": "🔁"}
|
||||
|
||||
|
||||
@@ -16,7 +18,7 @@ def human_day(iso: str, today: date) -> str:
|
||||
return "вчера"
|
||||
if delta < 0:
|
||||
return f"просрочено на {-delta} дн."
|
||||
return d.strftime("%d.%m")
|
||||
return d.strftime("%d.%m.%Y")
|
||||
|
||||
|
||||
def item_line(it: dict, today: date) -> str:
|
||||
@@ -45,7 +47,7 @@ def tree(nodes: list, depth: int = 0) -> list[str]:
|
||||
out = []
|
||||
for t in nodes:
|
||||
mark = "⏱" if t["running"] else ("▶️" if t["status"] == "doing" else "▫️")
|
||||
due = f" · до {t['due']}" if t["due"] else ""
|
||||
due = f" · до {ru_day(t['due'])}" if t["due"] else ""
|
||||
mins = f" · {t['minutes']} мин" if t["minutes"] else ""
|
||||
client = f" [{t['client']}]" if t["client"] else ""
|
||||
out.append(f"{' ' * depth}{mark} #{t['id']} {escape(t['title'])}{client}{due}{mins}")
|
||||
@@ -67,4 +69,4 @@ def routines(rows: list, today: date) -> str:
|
||||
if not rows:
|
||||
return "Регламентных дел пока нет. Скажи: «бэкап NAS раз в неделю»."
|
||||
return "\n".join(f"🔁 #{r['id']} {escape(r['title'])} · раз в {r['every_days']} дн. · {human_day(r['next_date'], today)}"
|
||||
+ (f" · последний раз {r['last_done']}" if r["last_done"] else "") for r in rows)
|
||||
+ (f" · последний раз {ru_day(r['last_done'])}" if r["last_done"] else "") for r in rows)
|
||||
|
||||
Reference in New Issue
Block a user