summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Lee <changjin9792@gmail.com>2023-03-24 00:56:17 +0800
committerJason Lee <changjin9792@gmail.com>2023-03-24 00:56:17 +0800
commit286e5e2c438dedd150dc4f8811fffa11a96ded2a (patch)
treeb5606f1fbffb68688f2d8d39c5fb6a8aad6e8d40
parentf808f589078a19ff230e794d13cc078a82a7e5ea (diff)
[Feat] Display time for `showtask --tree`
issue #9
-rw-r--r--girok/utils/display.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/girok/utils/display.py b/girok/utils/display.py
index 8c77e69..c9977b4 100644
--- a/girok/utils/display.py
+++ b/girok/utils/display.py
@@ -174,7 +174,7 @@ def display_category_with_tasks(
if h > 12:
h -= 12
- time = f" / {h}:{m} {'PM' if afternoon else 'AM'}" if is_time else ''
+ time = f" {h}:{m} {'PM' if afternoon else 'AM'} " if is_time else ' '
remaining_days = task_utils.get_day_offset_between_two_dates(datetime.now(), deadline)
day_offset_message = f"{remaining_days} days left" if remaining_days > 0 else f"{abs(remaining_days)} days passed"
@@ -187,7 +187,7 @@ def display_category_with_tasks(
task_id = ""
task_name = Text(task['name'], style=Style(color=constants.TABLE_TASK_NAME_COLOR if task['task_id'] != marked_task_id else marked_color, bold=True))
task_remaining_days = Text(f" [{day_offset_message}]", style=Style(color='#F5F7F2' if task['task_id'] != marked_task_id else marked_color))
- task_date = Text(f" - {year}/{month}/{day} {weekday_name}", style=Style(color="white" if task['task_id'] != marked_task_id else marked_color))
+ task_date = Text(f" - {year}/{month}/{day}{time}{weekday_name}", style=Style(color="white" if task['task_id'] != marked_task_id else marked_color))
node_name = Text.assemble(task_id, task_name, task_remaining_days, task_date, style=Style(strike=True if task['task_id'] == marked_task_id and marked_color == constants.TABLE_TASK_DELETED_COLOR else False))
tree.add(node_name)