diff options
Diffstat (limited to 'src/gui/tasks/table')
-rw-r--r-- | src/gui/tasks/table/model.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/gui/tasks/table/model.py b/src/gui/tasks/table/model.py index 6b8133d..cb25b22 100644 --- a/src/gui/tasks/table/model.py +++ b/src/gui/tasks/table/model.py @@ -6,6 +6,7 @@ import time import math import util.array import util.range +import gui.tasks.duration columns = 4 @@ -34,7 +35,7 @@ class TableModel(QtCore.QAbstractTableModel): elif index.column() == 1: return task.name elif index.column() == 2: - return pp_duration(task.duration) + return gui.tasks.duration.format(task.duration) elif index.column() == 3: return task.tag else: @@ -103,14 +104,6 @@ def age_since(timestamp): else: return '1m' -def pp_duration(minutes: int): - if minutes >= 60 * 24: - return '' + str(math.floor(minutes / 60 / 24)) + 'd' - elif minutes >= 60: - return '' + str(math.floor(minutes / 60)) + 'h' - else: - return '' + str(minutes) + 'm' - def sort_key(task: Task, row: int): if row == 0: return task.created_at |