mirror of
https://github.com/kbenestad/ClubLedger.git
synced 2026-06-18 09:44:33 +00:00
fix: remove timezone abbreviation from receipt and statement timestamps
Timestamps now show YYYY-MM-DD HH:MM without a trailing TZ suffix. The configured timezone still controls which local time is displayed. https://claude.ai/code/session_01JuRTR5Xjx8emQsyerBgGU7
This commit is contained in:
parent
005d0ccd80
commit
f31d4cd282
1 changed files with 4 additions and 4 deletions
8
main.py
8
main.py
|
|
@ -308,17 +308,17 @@ def _fmt_dt(dt_str: str, s: dict) -> str:
|
|||
try:
|
||||
dt_utc = datetime.fromisoformat(dt_str.replace(' ', 'T')).replace(tzinfo=timezone.utc)
|
||||
local = dt_utc.astimezone(_display_tz(s))
|
||||
return local.strftime('%Y-%m-%d %H:%M %Z')
|
||||
return local.strftime('%Y-%m-%d %H:%M')
|
||||
except Exception:
|
||||
return dt_str[:16] + ' UTC'
|
||||
return dt_str[:16]
|
||||
|
||||
def _now_display(s: dict) -> str:
|
||||
"""Current time formatted in the configured display timezone."""
|
||||
try:
|
||||
local = datetime.now(timezone.utc).astimezone(_display_tz(s))
|
||||
return local.strftime('%Y-%m-%d %H:%M %Z')
|
||||
return local.strftime('%Y-%m-%d %H:%M')
|
||||
except Exception:
|
||||
return datetime.now(timezone.utc).strftime('%Y-%m-%d %H:%M UTC')
|
||||
return datetime.now(timezone.utc).strftime('%Y-%m-%d %H:%M')
|
||||
|
||||
def load_staff() -> list:
|
||||
if STAFF_FILE.exists():
|
||||
|
|
|
|||
Loading…
Reference in a new issue