Cybrkyd's Git Repositories

GitGen - commit: d563ddf

commit d563ddfc09396baad3cf6c1b6c967b76c9b78a6d9a352bcc9e6d1e3e724201e3
author cybrkyd <git@cybrkyd.com> 2026-03-01 15:48:00 +0000
committer cybrkyd <git@cybrkyd.com> 2026-03-01 15:48:00 +0000

Commit Message

Activity Graph hot fix

Using 30-day intervals to calculate months was not wise, especially when it comes to February. This fix should work better as it subtracts months from the current year/month. It eliminates the day-based calculation which caused February to disappear entirely from the graph.

📊 Diffstat

gitgen.py 3
1 files changed, 2 insertions(+), 1 deletions(-)

Diff

diff --git a/gitgen.py b/gitgen.py
index 9053b05..773ce52 100644
--- a/gitgen.py
+++ b/gitgen.py
@@ -154,7 +154,8 @@ class GitRepoScanner:
months_data = []
for i in range(11, -1, -1):
- month_date = today - datetime.timedelta(days=i*30)
+ total_months = today.year * 12 + (today.month - 1) - i
+ month_date = datetime.date(total_months // 12, total_months % 12 + 1, 1)
year_month = month_date.strftime('%Y-%m')
month_label = month_date.strftime('%b')
commit_count = monthly_commits.get(year_month, 0)