TI-22: The 'day' chart crashes if there is an open interval and no others

This commit is contained in:
Paul Beckingham 2016-07-04 08:08:24 -04:00
parent 4c84a87cba
commit 8372feafee
2 changed files with 12 additions and 2 deletions

View file

@ -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

View file

@ -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));