148 // compute the column spans, first |
148 // compute the column spans, first |
149 unsigned colspans[12] = {}; |
149 unsigned colspans[12] = {}; |
150 { |
150 { |
151 unsigned total_cols = 0; |
151 unsigned total_cols = 0; |
152 sys_days day{year_month_day{y, January, 1d}}; |
152 sys_days day{year_month_day{y, January, 1d}}; |
153 if (weekday{day}.iso_encoding() != 1) { |
|
154 colspans[0] = 1; |
|
155 total_cols = 1; |
|
156 } |
|
157 for (unsigned col = 0; col < 12; ++col) { |
153 for (unsigned col = 0; col < 12; ++col) { |
158 while (total_cols < html::columns && year_month_day{day}.month() <= month{col + 1}) { |
154 while (total_cols < html::columns && year_month_day{day}.month() <= month{col + 1}) { |
159 ++total_cols; |
155 ++total_cols; |
160 ++colspans[col]; |
156 ++colspans[col]; |
161 day += days{7}; |
157 day += days{7}; |