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 11using  System ; 
2- using  SourceGit . ViewModels ; 
32
43namespace  SourceGit . Commands 
54{ 
65    public  class  Statistics  :  Command 
76    { 
8-         public  Statistics ( string  repo ) 
7+         public  Statistics ( string  repo ,   int   max ) 
98        { 
109            WorkingDirectory  =  repo ; 
1110            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\" "; 
1312        } 
1413
1514        public  Models . Statistics  Result ( ) 
Original file line number Diff line number Diff line change 11using  System ; 
22using  System . Collections . Generic ; 
33using  System . Globalization ; 
4+ 
45using  LiveChartsCore ; 
56using  LiveChartsCore . Defaults ; 
67using  LiveChartsCore . SkiaSharpView ; 
@@ -138,7 +139,8 @@ public class Statistics
138139        public  Statistics ( ) 
139140        { 
140141            _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 ) ; 
142144            _thisMonthStart  =  _today . AddDays ( 1  -  _today . Day ) ; 
143145
144146            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)
5454        { 
5555            Task . Run ( ( )  => 
5656            { 
57-                 var  result  =  new  Commands . Statistics ( repo ) . Result ( ) ; 
57+                 var  result  =  new  Commands . Statistics ( repo ,   Preference . Instance . MaxHistoryCommits ) . Result ( ) ; 
5858                Dispatcher . UIThread . Invoke ( ( )  => 
5959                { 
6060                    _data  =  result ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments