bugfixing

This commit is contained in:
MuslemRahimi 2024-09-12 20:45:24 +02:00
parent bfe8c403e1
commit c51a6599ae

View File

@ -39,7 +39,7 @@ async def get_data(session, ticker):
data = ujson.loads(await response.text())['earnings']
# Filter for future earnings
future_dates = [item for item in data if datetime.strptime(item["date"], "%Y-%m-%d") > today]
future_dates = [item for item in data if datetime.strptime(item["date"], "%Y-%m-%d") >= today]
if future_dates:
nearest_future = min(future_dates, key=lambda x: datetime.strptime(x["date"], "%Y-%m-%d"))
try: