Compare commits

...

3 commits

Author SHA1 Message Date
Dmitrij D. Czarkoff
b8934be307
Merge 612bc2951c into 3b09ea45f5 2024-11-17 15:51:34 +01:00
Dmitrij D. Czarkoff
612bc2951c
fix: use current culture to adjust first days of the week 2024-11-17 14:38:58 +01:00
Dmitrij D. Czarkoff
0fbf53c360
fix: use preference MaxHistoryCommits 2024-11-17 14:38:58 +01:00
2 changed files with 4 additions and 3 deletions

View file

@ -1,4 +1,5 @@
using System; using System;
using SourceGit.ViewModels;
namespace SourceGit.Commands namespace SourceGit.Commands
{ {
@ -8,7 +9,7 @@ namespace SourceGit.Commands
{ {
WorkingDirectory = repo; WorkingDirectory = repo;
Context = 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() public Models.Statistics Result()

View file

@ -1,6 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using LiveChartsCore; using LiveChartsCore;
using LiveChartsCore.Defaults; using LiveChartsCore.Defaults;
using LiveChartsCore.SkiaSharpView; using LiveChartsCore.SkiaSharpView;
@ -138,7 +138,7 @@ namespace SourceGit.Models
public Statistics() public Statistics()
{ {
_today = DateTime.Now.ToLocalTime().Date; _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); _thisMonthStart = _today.AddDays(1 - _today.Day);
All = new StatisticsReport(StaticsticsMode.All, DateTime.MinValue); All = new StatisticsReport(StaticsticsMode.All, DateTime.MinValue);