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:
teknium1 2026-07-04 14:12:37 -07:00 committed by Teknium
parent ce82b0c3cf
commit 7e037e1a30

View file

@ -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"