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,