When calling summary command with :annotations hint, if the annotation
is longer than a certain length, it's going to be truncated. The issue
is that the length and truncation are done on a raw string without
considering UTF8 multibyte characters, so there are edge cases when an
annotation is truncated in the middle of a character creating an invalid
UTF8 string.
Added a test case for this scenario.
Signed-off-by: Maxim Beder <macsim.beder@gmail.com>
The bitwise or, `|` had higher precendence than the `>` test. Fixes the
following error:
not ok 4 - summary.t: Summary should work with :all hint
# FAIL: AssertionError on file test/summary.t line 213 in test_with_all_hint: 'self.assertIn("""':
# '
# Wk Date Day ID Tags Start End Time Total
# -- ---------- --- -- ---- -------- -------- ------- -------
# W13 2021-04-04 Sun @3 FOO 10:00:00 11:00:00 1:00:00 1:00:00
# W14 2021-04-05 Mon @2 BAR 10:00:00 11:00:00 1:00:00 1:00:00
# W14 2021-04-06 Tue @1 BAZ 10:00:00 11:00:00 1:00:00 1:00:00
#
# 3:00:00
# ' not found in '
# Wk Date Day ID Tags Start End Time Total
# --- ---------- --- -- ---- -------- -------- ------- -------
# W13 2021-04-04 Sun @3 FOO 10:00:00 11:00:00 1:00:00 1:00:00
# W14 2021-04-05 Mon @2 BAR 10:00:00 11:00:00 1:00:00 1:00:00
# W14 2021-04-06 Tue @1 BAZ 10:00:00 11:00:00 1:00:00 1:00:00
#
# 3:00:00
#
# '
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
It was possible for `summary` command, when used with the :all hint, to
skip over any intervals that start later than the first interval in the
database.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
- Add DatetimeParser::parse_range: If a date contains no time, it is assumed to be a fixed range, else an open range starting at given datetime
- Add tests for summary with named dates 'yesterday' and 'today'
- Remove closing of filter in CmdSummary.cpp
- Closes#333
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>