From f3af626c13690133fffa033c43b89267320f3d56 Mon Sep 17 00:00:00 2001 From: D3xt3r <44285870+0xd3xt3r@users.noreply.github.com> Date: Tue, 7 Sep 2021 22:57:22 +0530 Subject: [PATCH] time formation from configuration in log command time formatting provided in the configuration file is now also used to format "watson log" command output. --- watson/cli.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/watson/cli.py b/watson/cli.py index 22bd369b..32e1c67c 100644 --- a/watson/cli.py +++ b/watson/cli.py @@ -1105,7 +1105,7 @@ def _print(line): def _final_print(lines): pass - + timefmt = watson.config.get('options', 'time_format', '%H:%M') for i, (day, frames) in enumerate(frames_by_day): if i != 0: _print('') @@ -1132,8 +1132,8 @@ def _final_print(lines): frame.project, longest_project )), tags=(" "*2 if frame.tags else "") + style('tags', frame.tags), - start=style('time', '{:HH:mm}'.format(frame.start)), - stop=style('time', '{:HH:mm}'.format(frame.stop)), + start=style('time', frame.start.strftime(timefmt)), + stop=style('time', frame.stop.strftime(timefmt)), id=style('short_id', frame.id) ) for frame in frames