diff --git a/src/Commands/Statistics.cs b/src/Commands/Statistics.cs index adfcc574..40ecc24a 100644 --- a/src/Commands/Statistics.cs +++ b/src/Commands/Statistics.cs @@ -1,4 +1,5 @@ using System; +using SourceGit.ViewModels; namespace SourceGit.Commands { @@ -8,7 +9,7 @@ namespace SourceGit.Commands { WorkingDirectory = repo; Context = repo; - Args = $"log --date-order --branches --remotes -40000 --pretty=format:\"%ct$%aN\""; + Args = $"log --date-order --branches --remotes -{Preference.Instance.MaxHistoryCommits} --pretty=format:\"%ct$%aN\""; } public Models.Statistics Result() diff --git a/src/Models/Statistics.cs b/src/Models/Statistics.cs index b669eb55..6ee29e0c 100644 --- a/src/Models/Statistics.cs +++ b/src/Models/Statistics.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; - +using System.Globalization; using LiveChartsCore; using LiveChartsCore.Defaults; using LiveChartsCore.SkiaSharpView; @@ -138,7 +138,7 @@ namespace SourceGit.Models public Statistics() { _today = DateTime.Now.ToLocalTime().Date; - _thisWeekStart = _today.AddSeconds(-(int)_today.DayOfWeek * 3600 * 24); + _thisWeekStart = _today.AddDays(((int)_today.DayOfWeek + (int)CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek) % 7 - 7); _thisMonthStart = _today.AddDays(1 - _today.Day); All = new StatisticsReport(StaticsticsMode.All, DateTime.MinValue);