fix image_poster.py to only show specified month
This commit is contained in:
parent
f6d5004ae4
commit
0722444a3c
@ -22,6 +22,7 @@ def parseArgs(parser):
|
|||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
def load_events(csv_path:str, month:int) -> list[dict]:
|
def load_events(csv_path:str, month:int) -> list[dict]:
|
||||||
|
monthafter = month + relativedelta.relativedelta(months=1, day=1)
|
||||||
events = []
|
events = []
|
||||||
with open(csv_path) as csv_file:
|
with open(csv_path) as csv_file:
|
||||||
csv_reader = csv.reader(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,
|
current_event = {"date":event_date_parsed,
|
||||||
"time":event_time,
|
"time":event_time,
|
||||||
"title":event_title.strip()}
|
"title":event_title.strip()}
|
||||||
if event_date_parsed >= month:
|
if event_date_parsed >= month and event_date_parsed < monthafter:
|
||||||
events.append(current_event)
|
events.append(current_event)
|
||||||
return events
|
return events
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user