mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-08 13:12:08 +00:00
fix: cover remaining GNU-only %-d strftime site in learning graph render
format_date() at line 76 still used %-d, which raises ValueError on Windows strftime. Same class as the axis-label site fixed by #56640; use dt.day directly. Credit also to @x7peeps (#58480) who flagged both sites.
This commit is contained in:
parent
ce82b0c3cf
commit
7e037e1a30
1 changed files with 2 additions and 1 deletions
|
|
@ -73,7 +73,8 @@ def format_date(ts: Optional[float]) -> str:
|
|||
if not ts:
|
||||
return "unknown"
|
||||
try:
|
||||
return datetime.fromtimestamp(float(ts), tz=timezone.utc).strftime("%-d %b %Y")
|
||||
dt = datetime.fromtimestamp(float(ts), tz=timezone.utc)
|
||||
return f"{dt.day} {dt.strftime('%b %Y')}"
|
||||
except (ValueError, OSError, OverflowError):
|
||||
return "unknown"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue