From 787fe4ad70c1543cfb4e44ac1e83fe2ed114b21c Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 26 Feb 2024 09:27:02 +0800 Subject: [PATCH] fix: month to index; fix using UTC time compare to local time --- src/Models/Statistics.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Models/Statistics.cs b/src/Models/Statistics.cs index b6214dee..7f4e4809 100644 --- a/src/Models/Statistics.cs +++ b/src/Models/Statistics.cs @@ -97,7 +97,7 @@ namespace SourceGit.Models { } public void AddCommit(string committer, double timestamp) { - var time = _utcStart.AddSeconds(timestamp); + var time = _utcStart.AddSeconds(timestamp).ToLocalTime(); if (time.CompareTo(_thisWeekStart) >= 0 && time.CompareTo(_thisWeekEnd) < 0) { Week.AddCommit((int)time.DayOfWeek, committer); } @@ -106,7 +106,7 @@ namespace SourceGit.Models { Month.AddCommit(time.Day - 1, committer); } - Year.AddCommit(time.Month, committer); + Year.AddCommit(time.Month - 1, committer); } public void Complete() {