From 4d1cdf027003b66504d3f83de647b04dfb551cba Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 16 Jul 2008 23:42:02 -0400 Subject: [PATCH] - For "task calendar", the month names are now centered over the month. --- src/report.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/report.cpp b/src/report.cpp index 2ff369410..e0ec8db90 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -1816,13 +1816,14 @@ void handleReportCalendar (TDB& tdb, T& task, Config& conf) for (int i = 0 ; i < monthsPerLine ; i++) { std::string month = Date::monthName (nextM); - std::cout << month - << " " - << std::setw(23 // one month's output width - - month.length ()// month name length - - 1)// spacer character - << std::left - << nextY; + int left = (18 - month.length ()) / 2 + 1; + int right = 18 - left - month.length (); + + std::cout << std::setw (left) << ' ' + << month + << ' ' + << nextY + << std::setw (right) << ' '; if (++nextM > 12) {