fix accidentally breaking the start of year

Sat, 01 Feb 2025 17:15:14 +0100

author
Mike Becker <universe@uap-core.de>
date
Sat, 01 Feb 2025 17:15:14 +0100
changeset 19
2c128952f198
parent 18
fd7a7785c963
child 20
8639ccd855ba

fix accidentally breaking the start of year

src/main.cpp file | annotate | diff | comparison | revisions
--- a/src/main.cpp	Sat Feb 01 16:59:45 2025 +0100
+++ b/src/main.cpp	Sat Feb 01 17:15:14 2025 +0100
@@ -263,6 +263,9 @@
 
             // initialize first day (which must be a Monday, possibly the year before)
             sys_days day_to_check = January / Monday[1] / report_year;
+            if (year_month_day{day_to_check}.day() != 1d) {
+                day_to_check -= days{7};
+            }
 
             // remember the starting point
             auto start = day_to_check;

mercurial