diff --git a/app/database/methods.py b/app/database/methods.py index fc1a556..1805e35 100644 --- a/app/database/methods.py +++ b/app/database/methods.py @@ -20,7 +20,7 @@ async def aggregate_salaries(collection: AsyncIOMotorCollection, dt_from: str, d "step": 1, "unit": group_type, "bounds": [ - iso(dt_from), iso(dt_upto) + iso(dt_from), iso(dt_upto) + dt.timedelta(days=int(group_type=="day"), hours=int(group_type=="hour")) * (iso(dt_upto).time() == dt.time(hour=0, minute=0, second=0)) ] } } @@ -56,4 +56,6 @@ async def aggregate_salaries(collection: AsyncIOMotorCollection, dt_from: str, d return {"dataset": dataset, "labels": labels} def iso(date: str) -> dt.datetime: - return dt.datetime.fromisoformat(date) \ No newline at end of file + return dt.datetime.fromisoformat(date) + +