diff --git a/src/task.cpp b/src/task.cpp index 631ea6c5a..a1180a247 100644 --- a/src/task.cpp +++ b/src/task.cpp @@ -1878,6 +1878,14 @@ std::string renderMonths ( table.setColumnJustification (i + 7, Table::right); } + // At most, we need 6 rows. + table.addRow (); + table.addRow (); + table.addRow (); + table.addRow (); + table.addRow (); + table.addRow (); + // Set number of days per month, months to render, and years to render. std::vector years; std::vector months; @@ -1899,10 +1907,10 @@ std::string renderMonths ( daysInMonth.push_back (Date::daysInMonth (thisMonth++, thisYear)); } - int row = table.addRow (); + int row = 0; // Loop through months to be added on this line. - for (int c = 0 ; c < monthsPerLine ; c++) + for (int c = 0; c < monthsPerLine ; c++) { // Reset row counter for subsequent months if (c != 0) @@ -1917,8 +1925,8 @@ std::string renderMonths ( table.addCell (row, thisCol, d); - if (conf.get ("color", true) && - today.day () == d && + if (conf.get ("color", true) && + today.day () == d && today.month () == months.at (c) && today.year () == years.at (c)) table.setCellFg (row, thisCol, Text::cyan); @@ -1928,9 +1936,9 @@ std::string renderMonths ( { Date due (::atoi (it->getAttribute ("due").c_str ())); - if (conf.get ("color", true) && - due.day () == d && - due.month () == months.at (c) && + if (conf.get ("color", true) && + due.day () == d && + due.month () == months.at (c) && due.year () == years.at (c)) { table.setCellFg (row, thisCol, Text::black); @@ -1940,18 +1948,7 @@ std::string renderMonths ( // Check for end of week, and... if (dow == 6 && d < daysInMonth.at (c)) - { - // ... Add a row if required, or... - if (c == 0) - { - row = table.addRow (); - } - // ... Reuse existing row. - else - { - row++; - } - } + row++; } } diff --git a/task.html b/task.html index 191868086..38b89130f 100644 --- a/task.html +++ b/task.html @@ -74,7 +74,6 @@ body { #content h4 { font-size: 18px; margin: 1.2em 0 0.3em; - border-bottom: 1px dotted #bbb; } #content h5 {