src/html.cpp

changeset 26
0b3a92df96db
parent 22
a9230f197e61
child 35
d75805c1e3b9
equal deleted inserted replaced
25:b8d6b14c1555 26:0b3a92df96db
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};

mercurial