Skip to content

Commit 740c8b9

Browse files
committed
fix: use current culture to adjust first days of the week
1 parent 434777d commit 740c8b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Models/Statistics.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3-
3+
using System.Globalization;
44
using LiveChartsCore;
55
using LiveChartsCore.Defaults;
66
using LiveChartsCore.SkiaSharpView;
@@ -138,7 +138,7 @@ public class Statistics
138138
public Statistics()
139139
{
140140
_today = DateTime.Now.ToLocalTime().Date;
141-
_thisWeekStart = _today.AddSeconds(-(int)_today.DayOfWeek * 3600 * 24);
141+
_thisWeekStart = _today.AddDays(-7 + (int)_today.DayOfWeek + (int)CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek);
142142
_thisMonthStart = _today.AddDays(1 - _today.Day);
143143

144144
All = new StatisticsReport(StaticsticsMode.All, DateTime.MinValue);

0 commit comments

Comments
 (0)