mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
enhance: slightly improve statistics (#711)
* use preference MaxHistoryCommits * use current culture to adjust first days of the week
This commit is contained in:
parent
5b55e3530d
commit
309db6e362
2 changed files with 4 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue