From 3eb5a526d1f9fd71dcfecab5f6c807c928273c47 Mon Sep 17 00:00:00 2001 From: Campbell Alden Date: Thu, 7 Jul 2022 10:00:45 +0900 Subject: [PATCH] Manually filter logbook entries since the last='d1' style seems to miss entries --- dump.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dump.py b/dump.py index 8de0fe8..eb00579 100644 --- a/dump.py +++ b/dump.py @@ -102,8 +102,9 @@ class LogbookFormatter: def generate_signoff_message(target_tag): format_tasks = make_recursive_formatter(LogbookFormatter()) - todays_logged_items = things.logbook(last='1d') - reportable = list(filter(lambda t: has_tag(t, target_tag), todays_logged_items)) + import datetime + today_str = str(datetime.datetime.today()).split()[0] + reportable = list(filter(lambda t: has_tag(t, target_tag) and t['stop_date'] == today_str, things.logbook())) structured_tasks = tasks_to_heirarchy({ 'title': 'Stopping now', 'notes': '', 'status': '' }, reportable) return format_tasks(structured_tasks, 0)