From 0722444a3cd5157381de6684d5f88c3bd65f42ab Mon Sep 17 00:00:00 2001 From: fram3d Date: Fri, 24 May 2024 01:19:32 +0200 Subject: [PATCH] fix image_poster.py to only show specified month --- image_poster.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/image_poster.py b/image_poster.py index 6f43f19..28a21b2 100755 --- a/image_poster.py +++ b/image_poster.py @@ -22,6 +22,7 @@ def parseArgs(parser): return parser.parse_args() def load_events(csv_path:str, month:int) -> list[dict]: + monthafter = month + relativedelta.relativedelta(months=1, day=1) events = [] with open(csv_path) as csv_file: csv_reader = csv.reader(csv_file) @@ -34,7 +35,7 @@ def load_events(csv_path:str, month:int) -> list[dict]: current_event = {"date":event_date_parsed, "time":event_time, "title":event_title.strip()} - if event_date_parsed >= month: + if event_date_parsed >= month and event_date_parsed < monthafter: events.append(current_event) return events