From fb2ed90e177c6a1a9458543d3ef45d93cdf6574c Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Mon, 4 Nov 2024 08:54:40 +0100 Subject: [PATCH] Fix stats --- IM/Stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IM/Stats.py b/IM/Stats.py index 1e657b4e..46138a21 100644 --- a/IM/Stats.py +++ b/IM/Stats.py @@ -114,7 +114,7 @@ def get_stats(init_date="1970-01-01", end_date=None, auth=None): if db.db_type == DataBase.MONGO: filt = InfrastructureList._gen_filter_from_auth(auth) if end_date: - filt["date"] = {"$lte": end_date} + filt["date"] = {"$lte": datetime.datetime.strptime(end_date, "%Y-%m-%d").timestamp} res = db.find("inf_list", filt, {"id": True, "data": True, "date": True}, [('id', -1)]) else: where = InfrastructureList._gen_where_from_auth(auth)