diff --git a/ChangeLog b/ChangeLog index 4e8af8c7..2a079221 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,7 @@ (thanks to Aaron Curtis). - TI-20 Week number does not agree with Taskwarrior (thanks to Dirk Deimeke). +- TI-22 The 'day' chart crashes if there is an open interval and no others - timew 0.9.5~alpha install bug (thanks to Gordon Ball). - Improved out-of-source build for themes, holidays diff --git a/src/commands/CmdChart.cpp b/src/commands/CmdChart.cpp index 592c09fa..30793a9d 100644 --- a/src/commands/CmdChart.cpp +++ b/src/commands/CmdChart.cpp @@ -265,8 +265,17 @@ static void determineHourRange ( } } - first_hour = std::max (first_hour - 1, 0); - last_hour = std::min (last_hour + 1, 23); + if (first_hour == 23 && + last_hour == 0) + { + first_hour = Datetime ().hour (); + last_hour = std::min (first_hour + 1, 23); + } + else + { + first_hour = std::max (first_hour - 1, 0); + last_hour = std::min (last_hour + 1, 23); + } } debug (format ("Day range is from {1}:00 - {2}:00", first_hour, last_hour));