From 543848ae684d7bde1a1e2d0f76c37070d23a90cc Mon Sep 17 00:00:00 2001 From: Thomas Lauf Date: Sat, 19 May 2018 11:28:07 +0200 Subject: [PATCH] Take change of month into account when calculating interval widths - Fixes #135: Task at month end not getting displayed --- src/commands/CmdChart.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/CmdChart.cpp b/src/commands/CmdChart.cpp index a5296c9a..848d4dd1 100644 --- a/src/commands/CmdChart.cpp +++ b/src/commands/CmdChart.cpp @@ -387,7 +387,7 @@ static std::string renderTotal ( { int hours = work / 3600; int minutes = (work % 3600) / 60; - std::cout << " " + std::cout << " " << std::setw (3) << std::setfill (' ') << hours << ':' << std::setw (2) << std::setfill ('0') << minutes; @@ -540,7 +540,7 @@ static void renderInterval ( auto end_mins = (clipped.range.end.hour () - first_hour) * 60 + clipped.range.end.minute (); if (clipped.range.end.hour () == 0) - end_mins += (clipped.range.end.day() - clipped.range.start.day()) * 24 * 60; + end_mins += (clipped.range.end.day() + (clipped.range.end.month () - clipped.range.start.month () - 1) * clipped.range.start.day ()) * 24 * 60; work = clipped.range.total ();