src/main.cpp

changeset 12
d869ff924c19
parent 11
127fb6a8f706
child 13
e714005f3e9d
equal deleted inserted replaced
11:127fb6a8f706 12:d869ff924c19
226 226
227 // initialize counters 227 // initialize counters
228 unsigned column = 0, row = 0; 228 unsigned column = 0, row = 0;
229 229
230 // initialize first day (which must be a Monday, possibly the year before) 230 // initialize first day (which must be a Monday, possibly the year before)
231 chrono::sys_days day_to_check{report_begin}; 231 chrono::sys_days day_to_check = chrono::January / chrono::Monday[1] / chrono::year{year};
232 day_to_check -= chrono::days{chrono::weekday{day_to_check}.iso_encoding() - 1};
233 232
234 // remember the starting point 233 // remember the starting point
235 auto start = day_to_check; 234 auto start = day_to_check;
236 235
237 // now add all entries for Monday, Tuesdays, etc. always starting back in january 236 // now add all entries for Monday, Tuesdays, etc. always starting back in january

mercurial