File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
- using SourceGit . ViewModels ;
3
2
4
3
namespace SourceGit . Commands
5
4
{
6
5
public class Statistics : Command
7
6
{
8
- public Statistics ( string repo )
7
+ public Statistics ( string repo , int max )
9
8
{
10
9
WorkingDirectory = repo ;
11
10
Context = repo ;
12
- Args = $ "log --date-order --branches --remotes -{ Preference . Instance . MaxHistoryCommits } --pretty=format:\" %ct$%aN\" ";
11
+ Args = $ "log --date-order --branches --remotes -{ max } --pretty=format:\" %ct$%aN\" ";
13
12
}
14
13
15
14
public Models . Statistics Result ( )
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections . Generic ;
3
3
using System . Globalization ;
4
+
4
5
using LiveChartsCore ;
5
6
using LiveChartsCore . Defaults ;
6
7
using LiveChartsCore . SkiaSharpView ;
@@ -138,7 +139,8 @@ public class Statistics
138
139
public Statistics ( )
139
140
{
140
141
_today = DateTime . Now . ToLocalTime ( ) . Date ;
141
- _thisWeekStart = _today . AddDays ( ( ( int ) _today . DayOfWeek + ( int ) CultureInfo . CurrentCulture . DateTimeFormat . FirstDayOfWeek ) % 7 - 7 ) ;
142
+ var weekOffset = ( 7 + ( int ) _today . DayOfWeek - ( int ) CultureInfo . CurrentCulture . DateTimeFormat . FirstDayOfWeek ) % 7 ;
143
+ _thisWeekStart = _today . AddDays ( - weekOffset ) ;
142
144
_thisMonthStart = _today . AddDays ( 1 - _today . Day ) ;
143
145
144
146
All = new StatisticsReport ( StaticsticsMode . All , DateTime . MinValue ) ;
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ public Statistics(string repo)
54
54
{
55
55
Task . Run ( ( ) =>
56
56
{
57
- var result = new Commands . Statistics ( repo ) . Result ( ) ;
57
+ var result = new Commands . Statistics ( repo , Preference . Instance . MaxHistoryCommits ) . Result ( ) ;
58
58
Dispatcher . UIThread . Invoke ( ( ) =>
59
59
{
60
60
_data = result ;
You can’t perform that action at this time.
0 commit comments