From 9873a8186ab345b6ee835da56d761bce80f39cd2 Mon Sep 17 00:00:00 2001 From: Fusion Date: Tue, 19 May 2026 13:10:10 +0200 Subject: [PATCH] fix: send ISO format dates instead of Unix timestamps Backend was sending Unix timestamps as strings (e.g. '1716112800') which JavaScript Date couldn't parse. Now sends proper ISO 8601 format dates that work with new Date() in the browser. --- apps/api/src/utils/git_history.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/api/src/utils/git_history.py b/apps/api/src/utils/git_history.py index 7bc9e03..8dae1dd 100644 --- a/apps/api/src/utils/git_history.py +++ b/apps/api/src/utils/git_history.py @@ -2,6 +2,7 @@ import subprocess from dataclasses import dataclass +from datetime import datetime, timezone from typing import Any @@ -182,10 +183,10 @@ def get_commit_detail(repo_path: str, commit_hash: str) -> dict[str, Any]: "parents": parents, "author_name": author, "author_email": email, - "author_date": str(timestamp), + "author_date": datetime.fromtimestamp(timestamp, tz=timezone.utc).isoformat(), "committer_name": author, # TODO: extract committer separately "committer_email": email, # TODO: extract committer separately - "committer_date": str(timestamp), + "committer_date": datetime.fromtimestamp(timestamp, tz=timezone.utc).isoformat(), "message": message, "body": body, "branches": branch_map.get(commit_hash, []), @@ -361,7 +362,7 @@ def _commit_to_dict(commit: Commit, graph_symbol: str = "", graph_depth: int = 0 "parents": commit.parents, "author_name": commit.author, "author_email": commit.email, - "author_date": str(commit.timestamp), + "author_date": datetime.fromtimestamp(commit.timestamp, tz=timezone.utc).isoformat(), "message": commit.message, "refs": refs, "graph_symbol": graph_symbol,